Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 75

Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
02/15/13 12:22 PM (12 years ago)

How do I get Android to see the same source code as two different apps?

I have a paid Android app and a free Android app both use the same source code and BT App control panel. In the free version I changed the icon images in the source code and also integrated RevMob to generate ad revenue. However, when I install the "free" version on my device it wants to up the paid version and visa versa. Because I'm using the same source code the Android device thinks it is the same app. How do I get Android to see these as two different apps? It is as easy as changing something in the AndroidManifest.xml file? I did try changing the package name in the AndroidManifest.xml, but that create a LOT of errors. I'm sure that is because that package name is referenced through the source code. Has anyone successfully done with this the same source code and was able to have both version on the same device?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
02/15/13 01:43 PM (12 years ago)
Hey Moto, I think if you change the package name in all files for one version of the app, you would be good. The reason it sees them as the same is because both versions of your app have the same package name (i.e. com.freeversion), and that has to be unique between different apps. Otherwise, it's considered an upgrade. You could use something like Notepad++ or TextWrangler to change all the instances of com.freeversion (as an example) in your app source to whatever, and that "should" make it a unique app. I "think" that would allow both of them to be controlled by the BT control panel, but I'd have to give that a bit more thought. Mark
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
02/15/13 01:43 PM (12 years ago)
I found the answer to my question. I had to rename the package in Eclipse using the Rename Application Package utility. Right click your Application in Package Explorer > Android Tools > Rename Application Package. I change the package name to com.APPNAMEfree Select YES at the prompt....DONE. Much easier then I thought it would be.
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
02/15/13 01:45 PM (12 years ago)
Thanks Mark - I think I found the solution. So far so good both apps are seeing the same data from the BT control panel.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
02/15/13 01:48 PM (12 years ago)
Awesome! That's good info to have...thanks!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/15/13 01:49 PM (12 years ago)
At the core of each application is what Apple calls the 'Bundle ID', and Android calls the 'Package Name'. That's unique. If you've created two packages with the same package name, you've created the same app twice. refactor/rename? I dunno... Cheers! -- Smug Late to the party again, but good to know for sure. Thanks!
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/15/13 11:00 PM (12 years ago)
You should really use "refactor--rename" to rename the package. It not only renames the package, but looks for all references to the package name within the package files and updates them as well.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.