H holdemadvantage Active Member Licensed User Longtime User Aug 28, 2014 #1 Noob question: how can i save my app's package name in a string variable?
Air Member Licensed User Longtime User Aug 29, 2014 #2 holdemadvantage said: Noob question: how can i save my app's package name in a string variable? Click to expand... If your Package-Name is "com.myapp" In MainActivity insert... B4X: Sub Process_Globals Dim PName as String : PName = "com.myapp" End Sub To use your Variable from Main Activity... B4X: Sub Fill_Label myLabel.Text = PName End Sub To use your Variable from any other Activity... B4X: Sub Fill_Label myLabel.Text = Main.PName End Sub Upvote 0
holdemadvantage said: Noob question: how can i save my app's package name in a string variable? Click to expand... If your Package-Name is "com.myapp" In MainActivity insert... B4X: Sub Process_Globals Dim PName as String : PName = "com.myapp" End Sub To use your Variable from Main Activity... B4X: Sub Fill_Label myLabel.Text = PName End Sub To use your Variable from any other Activity... B4X: Sub Fill_Label myLabel.Text = Main.PName End Sub
DonManfred Expert Licensed User Longtime User Aug 29, 2014 #3 http://www.b4x.com/android/forum/threads/get-the-currently-running-activity.39387/#post-234022 Upvote 0
H holdemadvantage Active Member Licensed User Longtime User Aug 29, 2014 #4 Thanks.yes i need to extract package name from manifest/apk running the code, i would like to protect my app from decompiling/recompiling and reskin Upvote 0
Thanks.yes i need to extract package name from manifest/apk running the code, i would like to protect my app from decompiling/recompiling and reskin
udg Expert Licensed User Longtime User Aug 29, 2014 #5 Maybe a function like could help: B4X: Sub GetPackageName As String Dim r As Reflector Return r.GetStaticField("anywheresoftware.b4a.BA", "packageName") End Sub It uses the Reflection library. Upvote 0
Maybe a function like could help: B4X: Sub GetPackageName As String Dim r As Reflector Return r.GetStaticField("anywheresoftware.b4a.BA", "packageName") End Sub It uses the Reflection library.
H holdemadvantage Active Member Licensed User Longtime User Aug 29, 2014 #6 very nice, thank you all Upvote 0
tdocs2 Well-Known Member Licensed User Longtime User Feb 16, 2015 #7 Thanks.yes i need to extract package name from manifest/apk running the code, i would like to protect my app from decompiling/recompiling and reskin Click to expand... @holdemadvantage How has it worked out? I assume you encrypted the string you were comparing against the package name returned. Upvote 0
Thanks.yes i need to extract package name from manifest/apk running the code, i would like to protect my app from decompiling/recompiling and reskin Click to expand... @holdemadvantage How has it worked out? I assume you encrypted the string you were comparing against the package name returned.
tdocs2 Well-Known Member Licensed User Longtime User Feb 16, 2015 #8 @udg Very clever and succint. Thank you. Sandy Upvote 0
H holdemadvantage Active Member Licensed User Longtime User Feb 16, 2015 #9 yes @tdocs, in order to make a little protection of my apk as reuse simple apps is very easy, i usually encrypt also admob code because thief steal apk to monetyze their own admob code Upvote 0
yes @tdocs, in order to make a little protection of my apk as reuse simple apps is very easy, i usually encrypt also admob code because thief steal apk to monetyze their own admob code
tdocs2 Well-Known Member Licensed User Longtime User Feb 16, 2015 #10 holdemadvantage said: i usually encrypt also admob code Click to expand... Thank you, Holdem. What is admob code? Sandy Upvote 0
holdemadvantage said: i usually encrypt also admob code Click to expand... Thank you, Holdem. What is admob code? Sandy
H holdemadvantage Active Member Licensed User Longtime User Feb 16, 2015 #11 Admob code is a code you have to use to display banner ads and interstitials ads in your apps, see https://www.b4x.com/android/forum/threads/admob-tutorial-add-ads-to-your-application.7300/ Upvote 0
Admob code is a code you have to use to display banner ads and interstitials ads in your apps, see https://www.b4x.com/android/forum/threads/admob-tutorial-add-ads-to-your-application.7300/
abhishek007p Active Member Licensed User Longtime User Feb 20, 2016 #13 B4X: Application.PackageName Upvote 0