Saturday, February 26, 2011

[android-developers] Re: Check permissions

What the others have said is true, but if you want to check the
permissions you can with the PackageManager's checkPermission

http://developer.android.com/reference/android/content/pm/PackageManager.html#checkPermission(java.lang.String,
java.lang.String)

On Feb 26, 1:40 am, Miguel Morales <therevolti...@gmail.com> wrote:
> Well, since you are modifying the manifest and recompiling a new apk for
> each version anyway.
> Simply have a file such as Const.java in which you define some static fields
> which you can check against at runtime.
> You'll have to still make changes to two places, but you won't have to touch
> your code directly.
> Also, yes permissions have to be accepted for your app to run and there is
> no need to check at runtime.
>
>
>
>
>
>
>
>
>
> On Fri, Feb 25, 2011 at 11:17 PM, b_t <bartata...@gmail.com> wrote:
> > Hi,
>
> > What is the correct way to check if app has a permission, for example
> > "android.permission.READ_SMS".
> > I would like to create different versions of my app with the same code
> > but different manifest xml with different permissions.
>
> > So I would like to check runtime if this version has a permission or
> > not.
>
> > Thanks,
> > Tamás
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> ~ Jeremiah:9:23-24
> Android 2D MMORPG:http://developingthedream.blogspot.com/,http://www.youtube.com/user/revoltingx

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment