AndroidManifest.xml problems when including permission

sefarat

Member
Licensed User
Longtime User
Hi, I have tried to add the following line in the androidmanifest.xml file but when running the application it always uses the androidmanifest-example.xml instead.

<uses-permission android:name="android.permission.SET_WALLPAPER"/>

Using the androidmanifest-example.xml I cannot set as a wallpaper any picture.

I have used the menu option: Project - Do not Overwrite Manifest file, but when I tried to run the application it always said:

Using existing AndroidManifest.xml.
(Project - Do Not Overwrite Manifest option is checked)
AndroidManifest-Example.xml file will be created instead.

I have look for a solution in the forum but I cannot find anything.

Thanks in advance and kind regards
Juan
 

pluton

Active Member
Licensed User
Longtime User
Hi Sefarat

Did you try this method:

Add permision:
<uses-permission android:name="android.permission.SET_WALLPAPER"/>

into androidmanifest.xml and put that file again read-only

Then delete androidmanifest-example.xml and in B4A program put Project - Do not Overwrite Manifest file and then try

Hope I help you :sign0089:
 
Upvote 0

pluton

Active Member
Licensed User
Longtime User

Now I read your question again and did you check what permission are actually used in your compiled app. Because this bolded text is normal when you check Do Not Overwrite....

Did you try in your app set some picture as wallpaper. Put the code here and I'll check it
 
Upvote 0

sefarat

Member
Licensed User
Longtime User
Hi, here you have the code:

Sub SetWallPaper(Bmp As Bitmap)
Dim r As Reflector
r.Target = r.RunStaticMethod("android.app.WallpaperManager", "getInstance", _
Array As Object(r.GetContext), Array As String("android.content.Context"))
r.RunMethod4("setBitmap", Array As Object(Bmp), Array As String("android.graphics.Bitmap"))
End Sub

Sub Button1_Click

SetWallPaper(LoadBitmap(File.DirAssets, Image"&Main.wallpaper&".jpg"))

End Sub

I have tried both, put the file as read-only and check the option: "do not overwrite"

Thanks for your help!
Sefarat
 
Upvote 0

sefarat

Member
Licensed User
Longtime User
Hi again..., now is working fine.

I think the xml was not correctly written :-(

Thanks for your help!!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…