#1 2016-06-22 10:52:10

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

[FIXED] Do have problems with Android 6 ?

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

Last edited by svanneste (2016-06-23 17:13:42)

Offline

#2 2016-06-22 11:07:00

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

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:

npm update -g cordova

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

Offline

#3 2016-06-22 11:38:22

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [FIXED] Do have problems with Android 6 ?

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 smile

Offline

#4 2016-06-22 11:54:04

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

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?

Offline

#5 2016-06-22 12:01:57

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [FIXED] Do have problems with Android 6 ?

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)

Offline

#6 2016-06-22 12:04:30

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

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):

at8OrzJ.png

Offline

#7 2016-06-22 12:08:07

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [FIXED] Do have problems with Android 6 ?

I can only confirm that all is installed, David sad
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

Offline

#8 2016-06-22 12:13:33

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

Hello Samuel,

svanneste wrote:

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...

Offline

#9 2016-06-22 12:19:11

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [FIXED] Do have problems with Android 6 ?

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

Offline

#10 2016-06-22 12:32:22

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

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...

Offline

#11 2016-06-22 12:45:14

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

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?

Offline

#12 2016-06-22 12:47:57

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [FIXED] Do have problems with Android 6 ?

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 smile)

Offline

#13 2016-06-22 12:48:21

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

Hello,

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

https://github.com/apache/cordova-plugi … oid-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.

Offline

#14 2016-06-22 12:55:11

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

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.

Offline

#15 2016-06-22 13:29:27

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

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...

Offline

#16 2016-06-22 15:17:44

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [FIXED] Do have problems with Android 6 ?

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 smile

Offline

#17 2016-06-22 15:46:25

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

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

Offline

#18 2016-06-22 16:08:00

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [FIXED] Do have problems with Android 6 ?

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

Offline

#19 2016-06-22 17:17:23

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

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...

Offline

#20 2016-06-22 17:37:57

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [FIXED] Do have problems with Android 6 ?

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 wink

Offline

#21 2016-06-22 17:58:27

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

Hello Samuel,

svanneste wrote:

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 wink

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

Offline

#22 2016-06-22 18:00:03

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [FIXED] Do have problems with Android 6 ?

David wrote:

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

Your application only, David big_smile

Offline

#23 2016-06-22 18:31:07

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [FIXED] Do have problems with Android 6 ?

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...

Offline

#24 2016-06-23 11:00:07

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: [FIXED] Do have problems with Android 6 ?

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


Joshua.Y

Offline

#25 2016-06-23 11:13:28

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [FIXED] Do have problems with Android 6 ?

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...

Last edited by svanneste (2016-06-23 17:30:00)

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.