The code that enables your paid features will then simply call the methods that test the package in your custom Application object, parse the package name, and decide on that basis whether a paid or free version is running, and then enable or disable the paid features accordingly. The activity objects in the manifest can then have an android:name attribute that is set to the proper Activity-derived class in the library (using a full path). The Grove at Piscataway Piscataway This list is currently closed. And of course you will want to have the package= attribute of the manifest element itself set to a distinct package that ends in something like. In the manifest for each of the two apps you will want the application element to have its android.name attribute set to the full path to your custom Application-derived class (as defined in the library). Your free and paid apps, at a minimum, may need only an AndroidManifest.xml file and a few resources (e.g., an application icon that distinguishes free from paid). That test can be made within a custom Application-derived object defined in the library project the package name can be obtained there by calling getPackageName(). Since separate apps on Android must each have a different package name, the easiest way to configure separate behavior is to test that package name in your library to see if it is presently running within the free or the paid version. I had originally planned to make the skins directory location configurable, but then it occurred to me that making the user select the directory in one place and then choose the skin in another. Although I haven't tried releasing code based on this to Google Play, I've created separate apps which can both run at the same time on a test device, with their own icons. This new version of Free42 for Android is meant to avoid these problems, by letting the user select skins from anywhere, using a file selection dialog. I've attempted this recently and it seems to work very well. IMO your best approach to creating multiple app releases from a single source is to use a library project. As of this writing, the Gradle build tool is still in beta state, so hopefully this will get added in the final release. However, one feature that is still missing is the ability to do conditional compiling in the source itself. The build system will create paid and free APKs for you. In short, you can structure your source like this: /src/main/Īll the shared code reside in /src/main, paid code in /src/paid and free code in /src/free. See Android Tools website for topic on 'Build Variants'. Update May 2013: The new Android build system based on Gradle makes building paid and free APK slightly easier. How to setup prebop is another topic altogther, it's complicated but worth it to have a single codebase. The above code will get removed, if the ant target you are building does not have the variable paid_version defined. You can add something in the code like this: /* $if paid_version$ */ However, there are some Ant tasks that can do this, e.g. One way to do this is with conditional compilation, which again, Java does not support. The free version will have critical methods/classes disabled, so that no one can tinker with database or xml to enable full functionality of the app. Ideally you should have one codebase, and able to compile a paid or free version at will. Whats new in Free42 APK 2.5.9a: No longer associates itself with all files, so Free42 wont be offered to open files of any types other than raw and f42. The newly loaded skin will then show up in the list of available skins.IMHO, Java/Android does not make it easy in this scenario. Finally, tap OK to dismiss the message box, and tap Done to dismiss the browser. You should get a message box telling you that the skin was loaded. With the gif or layout file showing, tap Load. then paste the URL into the text field at the top of the screen, replacing what's already there then tap Go. In the iOS version, the steps required to load a skin from an arbitrary URL would be: Main menu (tap in the top of the display) -> Select Skin -> Load. The skin loader is a fairly new feature, present in the iOS, MacOS, and Android versions. The skin loader in Free42 does not handle zip files, but if Streak圜obra were to put unzipped gif and layout files up on GitHub, it should be able to load those. Interesting! Is it supposed to work to open the download link from within the IOS app? I tried, the internal browser in the DM42 found the web page, but clicking on the desired zip file does not seem to accomplish anything.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |