Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm doing this currently in eclipse, and it is not difficult.</p> <ol> <li><p>Convert existing source to library project.</p></li> <li><p>Create two new projects, free and paid.</p></li> <li><p>Include the library project in the free and paid projects.</p></li> </ol> <p>It's not necessary to have a single Activity or resource inside the free/paid projects. All you need is a manifest for each which referenes the activities from your library. My free and full projects do not currently have a single java, resource, or layout file of any kind, it's just a manifest which references activities from the library.</p> <p>I use the exact same code for both projects, and I differentiate them by saying :</p> <pre><code>if(getApplicationContext().getPackageName().equals("full version package name")) { //do full stuff } else { //do free stuff } </code></pre> <p>Some gotchas I've hit, especially if you've already released your app on the market:</p> <ul> <li>If you change the full name/path of any activity, it will disappear from your homescreen. Therefore if your library has a different package name than the existing version, you will lose any homescreen icons. They can be replaced by the user but it's not ideal.</li> <li>Similar for appwidgets, if you change their receiver name, they will disappear on upgrade.</li> <li>You may not under any circumstance change the package name of a released application. </li> </ul> <p>If you've already released a free and pro version, it's somewhat unfortunate, because the activity path will need to change to a common library path, and you can't rename the released package to match the library path. So somebody will have to lose their existing icons.</p> <p>In my case I had only released a free version before splitting them, and I was able to name the library with the <em>same package name</em> as the free version. I was skeptical that you'd be allowed to include a library with the same package name as the wrapper package, but apparently it's possible to do so (working fine for me).</p> <p>So in my case I've got three projects:</p> <ul> <li>Core Library: package name : com.myname.myapp </li> <li>Free Version: package name : com.myname.myapp </li> <li>Pro Version: package name : com.myname.myapp.Pro</li> </ul> <p>And the free and full version manifests add activities which are named <code>com.myname.myapp.ActivityA</code> or <code>com.myname.myapp.ActivityB</code>, which exist only in the library project.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload