[FIXED] Do have problems with Android 6 ?


Samuel Vanneste

Hello,
After having upgraded my own phone to Android Marshmallow, I have noticed that some of my "already tested" apps aren't working properly anymore.
Perhaps does it come from the new "permissions method" but, for example, I don't get the location or the sensors.
So, I compiled the examples shipped with App Builder and they act the same on Android 6.

Do you have noticed something like this ? Thanks


decsoft

Hello Samuel,

I can't test it right now (unfortunatelly my phone didn't receive the Android 6 upgrade yet, but they are expected in the near future) but apparently Apache Cordova 6 support Android 6. Then what you can try is to upgrade Apache Cordova and build the applications with this latest Apache Cordova version.

Remember to upgrade Apache Cordova we can use the below command from a console:

If you continue having problems just post here sir. If finally you solve the problem, please, post here too.



Samuel Vanneste

Hello David,
In fact, I had already updated Cordova and I should have provided more details.

For the Location code example :
- the first time the app is launched
- I press "Get Location"
- I am asked if I allow the app to access the location and I agree
- if I press "Get location", nothing returns

But, I understand from your reply that is a problem with Cordova, not App Builder itself. So I will search at Cordova

Thanks a lot :)


decsoft

Hello Samuel,

Wait a minute... I think the behaviour you describe occur when the application is running from a browser, but not in Apache Cordova... are you sure the Apache Cordova's "Location" plugin is checked in the app options dialog? I asume you trying the application in your phone once they are build with Apache Cordova... right?



Samuel Vanneste

You are right David : I do try the app with the phone and building with Apache Cordova.
The location plugin is checked in the App's plugins option (and it still works with Lollipop)


decsoft

Hello again,

Another thing to take into consideration is the API version available in the Android SDK. Be sure you have installed the right API version for Android 6.0 (API 23):



Samuel Vanneste

I can only confirm that all is installed, David :(
But I don't want to spend your time, I will search more on the Cordova's part because App Builder seems to work like it should


decsoft

Hello Samuel,

You are right David : I do try the app with the phone and building with Apache Cordova.
The location plugin is checked in the App's plugins option (and it still works with Lollipop)

Please, don't worry: I am happy to help you and interested in this issue too. I want to investigate a little more out there...



Samuel Vanneste

They introduced a lot of modifications in Android 6 (and it is worst with N) : even the option to keep an app running in the background is changed and will probably fail (currently trying with a radio stream to check).

The app I am trying to get the location now is the one shipped with App Builder, the options are checked (I have uploaded the file without touching it if you would like to check.

And, as I understand it, David, as Android asks for permission at runtime (I mean the first time I press the "Get Location" button, Android asks the permission for the app to use the Location (previously it was only asked at install in release mode)), so the app seems to work the right way.

I will come back if I find more information or a solution


decsoft

Hello Samuel,

I am trying the Location sample in my Android 5.1.1 and something is wrong... the don't work like expected and no error messages appear or something like that. The permissions are asked when install the application, but the application does not work as we expect. They works in browsers, but not in Android.

So maybe the problem is not related with Android 6... I am investigating right now what can happend here...



decsoft

Hello Samuel,

Finally I get the Location sample application working here in Android 5.1.1. The problem is I turn off the Location in Android. Once they are turned on the application worked. However, I expect some kind of error if we can't access the location, for example, if they are turned off in the phone. I continue investigating this.

P.S. Can you assert your Android 6 phone have the Location turned on Samuel?



Samuel Vanneste

Hello David,
I confirm that the "Location" is turned on. I can confirm too that I can access the location using native Android code.
(I am happy that it still works with Lollipop for you or I would have not understood :))


decsoft

Hello,

Ok... I think I need to do something with this:

https://github.com/apache/cordova-plugin-geolocation#android-quirks

Apparently, the Error callback is not fired if certain stuff is not setup first. I need to perform some changes in App Builder. Please, Samuel, assert you have turned on the GPS/Location in your phone and try again the Location sample application. Anyway I want to do the appropiate changes to be informed (with an error) if the Location is turned off.



decsoft

Hello,

Ok. Knowing you have turned on the GPS/Location in your phone, let me to do the appropiate changes in App Builder before go ahead. I am working right now in that Samuel.



decsoft

Hello Samuel,

Please, upgrade your App Builder copy. The Location control have now a "Timeout" variable which allow us to specify certain ammount of time (in milliseconds) to fire the Error event if the GPS/Location is turned off, for example.

Please, Samuel, try with the Location sample in Android 6 and tell me if, at least, this time you receive some kind of error...



Samuel Vanneste

David, I am sad to say that it does not work (I took time because I just bought another phone running a stock Android 6 instead of an update but that is the same : no location, no sensor).

Perhaps someone here could confirm/infirm :)


decsoft

Hello Samuel,

Thanks for your tests and sorry for inconveniences. I want that you try the following: uninstall the application enterely from your phone, not "update" the application with a new APK, but uninstall the application and then try by installing it again.

For your convenience and also for anyone that want to try, below is the APK file for the Location app sample:

Location.zip



Samuel Vanneste

David,
I have uninstalled, rebooted and installed the apk you provided. And it works perfectly.
Please, do you see what I could do wrong ?


decsoft

Hello Samuel,

Glad to know than finally you got it working! You did nothing wrong sir. Apparently this is the expected Android 6.0 behaviour: They ask the user for permissions (Location in this case), and, if the user chooses "Never", then the application... never ask again for the permissions, but these must be enabled manually using the Android application's settings, except if the application is uninstalled: then the circle starts again when install it again.

We need to deal with this in some way...



Samuel Vanneste

Nope David
this :

They ask the user for permissions (Location in this case)

I did it and said it before.

But I got no location with my app. Even if I compile it again it does not (I choose the "run" batch file). Yours is working perfectly, Sir ;)


decsoft

Hello Samuel,

Nope David
this :
They ask the user for permissions (Location in this case)

I did it and said it before.

But I got no location with my app. Even if I compile it again it does not (I choose the "run" batch file). Yours is working perfectly, Sir ;)

So finally your application is working or just my attached application? That's the question! :)



Samuel Vanneste
So finally your application is working or just my attached application? That's the question! :)

Your application only, David :D


decsoft

Hello Samuel,

I am sorry for the inconveniences. So we have a problem here... please, delete by hand the "_Compiled" directory and try again building your application Samuel. Remember to use the latest App Builder release and also the latest release of Apache Cordova. Assert you have installed the API 23 with the Android SDK manager. Uninstall any previous version of the application in the device. And finally try with the new APK.

If my attached (APK) sample application works then your application must work too...



Yang Ghua

David,you are really working with enthusiasm, that impress me very much!:)


Samuel Vanneste

Hi there (and especially Sir David),
Spent a lot of time debugging the issue : the behavior is not (and absolutely not, consistent). So, I am currently testing all what the Dialogs and controls do.

No reason not to be enthusiastic...


decsoft

Hello,

David,you are really working with enthusiasm, that impress me very much!:)

Thanks Joshua!



decsoft

Hello Samuel,

Hi there (and especially Sir David),
Spent a lot of time debugging the issue : the behavior is not (and absolutely not, consistent). So, I am currently testing all what the Dialogs and controls do.

And for the moment, I can say that from a well designed View, I have got a blank one after having inserted a timer in the Resume event of that view.
https://s2.applicateur.fr/screenshot.png
No reason not to be enthusiastic...

About this latest problem, what happend if you run the application using the debugger? Some error appear?

On the other hand, what happend if you build the application sample "as is", without modifications? Because it's not possible app sample works if I build it and don't work if you build it, except if something in your environment is not completely correct: the Cordova version, the Android SDK API version, the installed Location plugin, etc. I think that the console output of the Cordova build process may can help here.



decsoft

Hello again,

Another thing Samuel, can you provide me your app sample, so I can take a look and also try to build it here?



Samuel Vanneste
Because it's not possible app sample works if I build it and don't work if you build it, except if something in your environment is not completely correct

Hello David,
I do absolutely agree and that what I am trying to find.


Samuel Vanneste
Another thing Samuel, can you provide me your app sample, so I can take a look and also try to build it here?

Sorry to spend your time (reason why I was trying to solve the issue by myself) but if you would like to download the project


decsoft

Hello Samuel,

Thanks for providing your app sample. I am investigating what can happend here, since I also experiment some problems with that. I will inform here about any progress.



decsoft

Hello Samuel,

Ok. Finally I found the problem and the cause of your "white screen" application. There is a bug in App Builder that, not only cause the app's Resume event never be executed, but also the "white screen" behaviour if we try to use such app's event. Sorry for the inconveniences...

The problem is fixed now and App Builder has been updated, so please, upgrade your program copy. Finally I can test your application and they works as expected Samuel. Just a couple of things to consider:

1º Probably the Min SDK (Cordova -> Android options) no need to be Android 6, but Android 4, for example. Just think that if you put Android 6 for the Min SDK then any other older Android can run the application, but why? Our applications can run from Android 4.0, so this probably must be the Min SDK.

2º Are you sure you need to specify the Java and other related paths? Remember there is optional and these paths can be leave "in blank" without problems. Of course if you really need to use that options, then go ahead: in fact if you can build your application, then probably you can continue using the paths as you setup in the attached application



Samuel Vanneste

Hello Sir David,
Thanks a lot for all the bests efforts you provided to fix

Ok. Finally I found the problem and the cause of your "white screen" application. There is a bug in App Builder that, not only cause the app's Resume event never be executed, but also the "white screen" behaviour.

I do confirm it is working perfectly great now.

Probably the Min SDK (Cordova -> Android options) no need to be Android 6, but Android 4, for example.

You are absolutely right and I tried many configurations trying to find why the location wasn't got, that I probably missed that point for the example provided. Sorry.
Are you sure you need to specify the Java and other related paths?

You are right too : I put them while trying to identify why it was not working. Sorry again. I wasn't sure I was using the right Android SDK and Java version (thought to go to the 32 bits to have the same configuration you have).

Now the good news : I don't know if you have touched that point but the Location is acquired. In some cases it doesn't refresh Label1 (probably when the Timer is waiting or Ticking (I have to investigate)).
But it is working. Thanks again David


decsoft

Hello Samuel,

Glad to know sir! About the "non refreshing label", please, try to call the "ApplyModel" action just after set the variable in the Location Success event. Something like:



Samuel Vanneste

Again, it was that (I will have to return to read the Help file because I wouldn't have thought about that). BiG THANK YOU David


decsoft

Hello,

You're welcome Samuel! Always thanks to you. :)


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.