Releasing 2 applications based on the same code but different package name

Like many Android developers, I want to have two programs for MarketPlace - a demo and a full version - they both have the same code, but use different assets. Unfortunately, since they have the same package namespace, they cannot be downloaded to the same device. By the way, assets are in the assets folder, and not in the res folder.

I want to make a second apk via the command line and get it from the first apk that was compiled / built using the NetBeans / Eclipse IDE.

The answer seemed aapt and its option --rename-package-manifest , but I clearly don't understand how to use it.

Follow the steps below:

  • Build my full apk with NetBeans

  • Unzip apk with apktool

  • Add New Assets

  • Rename the package with aapt

  • Reinstall the demo using apktool .

However, I cannot complete step 4 - the step of renaming aapt to work. I have seen so many streams on the Internet about this, but without an explicit example.

Then I tried the simplest testing programs - Hello World, using the following steps here .

Hello World works great using command line options, it builds and runs on both the emulator and the device.

However, when I use the aapt --rename-manifest-package command, it gives a lot of errors.

The command I use is:

  aapt package -f -v 
          -M c: \ android-sdk-windows \ tools \ hellow \ AndroidManifest.xml 
          -S c: \ android-sdk-windows \ tools \ hellow \ res
          β€”Rename-package-manifest com.myname.demo

Errors are found in both main.xml and AndroidManifest.xml in the form:

"Resource ID not found for attribute 'layout_width'"

Any ideas are really welcome.

+4
source share
1 answer

Use the Android library project as it was designed to fit your scenario. Here are instructions for using Android library projects with or without Eclipse .

+2
source

Source: https://habr.com/ru/post/1335807/


All Articles