Android Question Android 2.2 and OKHttp

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I am using OKHttp to download and check the current version of my software

B4X:
      Public    gGoogleStoreListingAddress         As String  = "https://play.google.com/store/apps/details?id=com.BOBs.BBS"
      Private  gHttpVersionJob               As HttpJob


 '------------------------------------------------------------------------------
 '  Download the current version number from Google and see if same as us
 '------------------------------------------------------------------------------       
       gHttpVersionJob.Initialize("version_check", Me)

       gHttpVersionJob.Download(gGoogleStoreListingAddress)

NOW this works perfectly on all devices I have but is crashing on a device running Android 2.2


When this crashes which it does on the Download statement I cannot trap it in a Try / Catch and it does not get caught by the Application_Error

At the point this crashes I know a few things.
Billing Manager 3 is Not supported
And I have an Internet connection

I have tried other URL's just to make sure that is not the problem.

My OKHttp is version 1.02 and my OKHttpUtils is 2.20


If this is a 2.2 problem is there a work around?

BobVal
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
That kind of helps with one problem (the crashing)

So does this mean I have to use the old HttpUtils for 2.2?

Very surprised the OKHttpUtils does not check the Android version and return an error message instead of crashing.

BobVal
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Can I be using both depending on the users software version?

If so how

I tried replacing the OKHttp libraries with just the Http. seems to work fine on my 4.2 but still failing on 2.2 with Java.Net.UnknownHostExecption play.google.com
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…