Create an APK ready ZW template

So you have created your awesome set of templates with ZW and you want to distribute them through the Android Market? Well, from 2.38 this is possible! You can create “template packs” with one or more templates inside, you can even start with 1 or 2 templates and then update the APK in the future as you do with normal apps. The APK will contain everything the layout needs, Iconsets, Bitmaps and Fonts. You will also be able to decide if the user can “re-save” them or not (basic copy protection).

If you are going to develop a paid skin please read carefully the last chapter!

Requirements

Before starting we need to make sure you have all the tools needed to go on, creating an APK is an advanced task so i won’t go through all the basics, you can find plenty of information on the net on how to create and distribute a basic Android app. So, that said, for this example we’ll need:

  • Zooper Widget PRO v2.38 or better (uh Yeah)
  • Android Market developer account
  • The Android SDK available here
  • Android Studio (you can also use Eclipse, but for this example i will use the studio)
  • A proper Java JDK 
Create APK ready ZW template
device-2013-06-23-150750

If you are here you masterpiece is already on screen, right? So just press the usual “save” button and select “Create APK zip”, a file called “templatename.zwapk.zip” will be stored in the “APKZips” folder inside the ZooperWidget SD directory. Just copy it on your system somewhere, you will see that the ZIP folder contains a directory called “assets”, that directory has to be copied inside the project, see next point. 

Download sample project
CopyToSampleProject
Download sample project from HERE and uncompress this in your workspace, copy the content of the APK template inside the project (where you’ll find an “assets” directory already.

Finally open Android studio and do the following:

  • Select “import project from existing sources”
  • Browse to the project folder
  • Press OK, give a name to your project and then next until Android Studio has successfully opened the project

TIP If you want to add more than one skin on a single project just repeat this step for all your skins, you only need to be sure that templates have been saved with different names.

TIP If your template does not contain any external resource (fonts, bitmaps, iconsets) you can also save the “.zw” file directly in “assets/templates” skipping the “apk” save option.

TIP To create a good looking app icon you can use the wonderful web app Android Asset Studio 

Edit Configuration

You are almost done, you need now to edit some files, in particular the AndroidManifest.xml and the “zooper.xml” inside res/values.  So:

  • Change “package” name in the AndroidManifest.xml and sent it to your package name (if you want to come up in the searches please use “zwskin” inside the package name
  • Change application launcher icons (ic_launcher) to your icon
  • Edit zooper.xml and edit values as explained inside the file

Naming

  • Please do not use Zooper Widget icon for your templates
  • Please do not use Zooper package namespace “org.zooper”, just use your own package name adding “zwskin” somewhere, so something like “com.myname.zwskin.mypack
  • You can use “Zooper Widget” in the app name, no problem, so “Awesome Skin for Zooper Widget” is fine
  • Please remember to mention in the description that APK skins works only with Zooper Widget PRO, otherwise you might have complains 

Done!!

That’s all, you can build now your project and test it in Zooper Widget, you will see your package in the list of available sources for loading templates. 

Include Zooper Templates in external icon packs

What if you are creating an ADW iconpack or a Nova plugin and you want to include also some great looking Zooper Widget template in it? Easy! Just add this to your android manifest:

1

2

3

4

5

6

7

8

9

10

    <!--

    This is the templates activity, if you are developing a skin project

    for a launcher or something else just add this to it to also allow

    ZW templates in the APK

    -->

    <activity android:name="ZooperTemplates"  android:exported="true">

      <intent-filter>

        <action android:name="org.zooper.zw.TEMPLATES" />

      </intent-filter>

    </activity>

Then just copy “zooper.xml” to your project and place all the data in the assets as for normal packs, that’s all, you will now have ZW templates included in your ADW theme or in any icon pack you are creating! 

Commercial icon packs
If you are developing a commercial skin please ensure that you have properly uncommented the “commercial” section in the AndroidManifest.xml file. This is very important otherwise skins won’t work once downloaded from the play store. Just replace “WRITE PACKAGENAME.templates HERE” with your package name + the “.templates” part.

1

2

3

4

5

6

7

8

9

10

        <!--

        COMMERCIAL SKINS ONLY:

        - Uncomment provider entry

        - Set android:authorities="PACKAGENAME.zwprovider"

          If package is "my.pkg.name.zwskin.sample" set it to "my.pkg.name.zwskin.sample.zwprovider"

        -->

        <provider

                android:name="org.zooper.zwskin.TemplateProvider"

                android:authorities="WRITE PACCKAGENAME.templates HERE"/>

        <!-- END Zooper Widget definition -->


Finally, if you are adding this skin to an existing project (so if you are not starting from sampleskin.zip file), please also ensure that you copied the content of the “src” directory into your source otherwise the provider won’t work.

Feedback and Knowledge Base