Access photos permission

71 views
Skip to first unread message

Gareth Murfin

unread,
Nov 29, 2016, 9:49:15 PM11/29/16
to CodenameOne Discussions
Apologies if I have asked this before but I cannot find it - my app is apparently asking some people for permission to access photos and media, what calls in the code will cause this? I thought I had got rid of them all. The people on google play are lunatic asylum escapees, a permission drives them into a wild frenzy, why does the world think everyone is hacking them :)

Shai Almog

unread,
Nov 29, 2016, 11:55:02 PM11/29/16
to CodenameOne Discussions
In the developer guide https://www.codenameone.com/manual/advanced-topics.html
We have a section where every Android permission is mapped to the methods/classes that trigger it. You can just search thru that. But make sure to check the build hints first to see that a cn1lib didn't inject a permission or something.

Gareth Murfin

unread,
Nov 30, 2016, 11:00:18 AM11/30/16
to CodenameOne Discussions
Thanks i dont see anything, I have capturePhoto call in commented out code, could that be causing it somehow ?

On 30 November 2016 at 12:55, Shai Almog <shai....@gmail.com> wrote:
In the developer guide https://www.codenameone.com/manual/advanced-topics.html
We have a section where every Android permission is mapped to the methods/classes that trigger it. You can just search thru that. But make sure to check the build hints first to see that a cn1lib didn't inject a permission or something.

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/RAVmkVhMrGs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/354432c5-0d34-4731-be9b-f18aecc8c643%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Gareth Murfin
(Android Freelancer - www.garethmurfin.co.uk)

Gareth Murfin

unread,
Nov 30, 2016, 7:53:34 PM11/30/16
to CodenameOne Discussions
I think its something new from Android it says do you want "Raffler to access photos, media and fileso n your device?" - I am downloading an image of the winner, and storing it is this it do you think? See screenshot never seen this on any other device apart from 2, one from client one from mate.  

Gareth Murfin

unread,
Nov 30, 2016, 11:19:15 PM11/30/16
to CodenameOne Discussions
ps this happens mid app - not at the start, im presuming it really is when i get an image to store.

Shai Almog

unread,
Dec 1, 2016, 12:46:13 AM12/1/16
to CodenameOne Discussions
It's possibly related to the capture API.

Gareth Murfin

unread,
Dec 1, 2016, 10:25:26 PM12/1/16
to CodenameOne Discussions
I actually did find a references to the capture api imported, i removed it but i am still getting this. 

Could this cause it ? surely this is internal, weird thing is I only see on 2 phones.

  String[] files = Storage.getInstance().listEntries(); 
        String whatHappened = deleteFiles(files);

or what about this ?  com.codename1.io.Util.downloadUrlToStorageInBackground(winnerPhoto, nameOfPhoto, imageCompleteListener);

Only happens on Android 6.0 it seems so far.

Gareth Murfin

unread,
Dec 1, 2016, 10:27:42 PM12/1/16
to CodenameOne Discussions
im thinking this... 

 String roots[] =FileSystemStorage.getInstance().getRoots();
                for (int i=0; i<roots.length; i++)
                {
                    _("ROOT: "+roots[i]);

Gareth Murfin

unread,
Dec 1, 2016, 10:54:56 PM12/1/16
to CodenameOne Discussions
ripped out everything i could yet its still happening. ;-(

Gareth Murfin

unread,
Dec 1, 2016, 11:01:32 PM12/1/16
to CodenameOne Discussions
this explains a bit 


although surely you dont need permission to write it internal storage?

Shai Almog

unread,
Dec 2, 2016, 12:33:24 AM12/2/16
to CodenameOne Discussions
That's a generic article about Android permission prompts. Did you activate permission prompts in the simulator?

Gareth Murfin

unread,
Dec 2, 2016, 3:20:49 AM12/2/16
to CodenameOne Discussions
Yes I did in the simulator I dont see anything pop up.

Shai Almog

unread,
Dec 3, 2016, 1:20:31 AM12/3/16
to CodenameOne Discussions
In the device if you deny the permission you would usually see an output stack pointing you at the rough direction.
Is it possible that there is native code that triggers that permission?

Gareth Murfin

unread,
Dec 5, 2016, 1:08:04 AM12/5/16
to CodenameOne Discussions
Unfortunately I cannot recreate them, only client can, I have tried geny motion with android 6 etc :-(

Shai Almog

unread,
Dec 6, 2016, 12:18:47 AM12/6/16
to CodenameOne Discussions
After you grant a permission to an app Android doesn't re-prompt. You need to go to the apps settings in Android and revoke its permissions to make the app prompt for them again.

Gareth Murfin

unread,
Dec 7, 2016, 6:34:20 AM12/7/16
to CodenameOne Discussions
Thanks Shai I will ask client to do that, I dont see anything in that link thatI aum using that would need access to media and files... Maybe it is due to us playing a video inside the app or something but that is stored in the jar.

Gareth Murfin

unread,
Dec 7, 2016, 7:08:35 AM12/7/16
to CodenameOne Discussions
Client sent me a video, simply opening a browser link inside the app says "requires permission. this is required to open the file", all I can doing is:

Display.getInstance().execute(url);

Gareth Murfin

unread,
Dec 7, 2016, 7:55:47 AM12/7/16
to CodenameOne Discussions
and then after that it asks for access to "photos,media and files on device", JUST from opening a link. Android 6 permissions are killing me, also none of this shows in simulator even with android 6 permissions ticked.

Shai Almog

unread,
Dec 8, 2016, 12:32:22 AM12/8/16
to CodenameOne Discussions
Do you have an app associated with that URL by any chance?

Gareth Murfin

unread,
Dec 8, 2016, 4:43:59 AM12/8/16
to CodenameOne Discussions
no, not even sure how to do that, all I want to do is launch a browser and visit it.

On 8 December 2016 at 13:32, Shai Almog <shai....@gmail.com> wrote:
Do you have an app associated with that URL by any chance?

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/RAVmkVhMrGs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.

For more options, visit https://groups.google.com/d/optout.

Gareth Murfin

unread,
Dec 8, 2016, 6:02:04 AM12/8/16
to CodenameOne Discussions
Also why do I never get any permissions with the android 6 permission option on the simulator? It would be the perfect way to debug of course but doesnt seem to work here? 

Gareth Murfin

unread,
Dec 8, 2016, 6:59:22 AM12/8/16
to CodenameOne Discussions
So if I set target sdk to 21, all my problems go away!

Shai Almog

unread,
Dec 9, 2016, 12:20:38 AM12/9/16
to CodenameOne Discussions
Yes as we mentioned in the permissions post https://www.codenameone.com/blog/switching-on-android-marshmallow-permission-prompts.html
SDK 21 didn't include this but if you submit to google with SDK 23 you can't revert. They don't accept that which is REALLY frustrating.

Gareth Murfin

unread,
Dec 9, 2016, 2:43:10 AM12/9/16
to CodenameOne Discussions
oh that could be bad!

On 9 December 2016 at 13:20, Shai Almog <shai....@gmail.com> wrote:
Yes as we mentioned in the permissions post https://www.codenameone.com/blog/switching-on-android-marshmallow-permission-prompts.html
SDK 21 didn't include this but if you submit to google with SDK 23 you can't revert. They don't accept that which is REALLY frustrating.

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/RAVmkVhMrGs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages