Lightning Launcher用のテンプレートを作成する方法
Lightning Launcher 8.3以降から、APKファイルによるテンプレート共有がサポートされました。
あなたが作成したカッコいいテーマや、ユニークなテーマを他のユーザと共有できます。
ご注意:この解説ページは、APKファイルが何であるか、またそれをソースからどのようにビルドし、配布するかを知っていることを前提に書かれています。よくわからない方はAndroidアプリ開発関係のサイトを読み漁るといいと思います。
簡単でサクッと完了する手順(推奨)
このツールを使用すると、テンプレートの名前を設定し、アイコンとテンプレートファイルをアップロードするだけでソースファイルが生成できます。生成後の作業はこのソースをビルドして署名し、Play Storeや自分のサイト、掲示板などでAPKファイルを共有するだけです。
(翻訳中)
応用的な手順の概要
This is the overall procedure to get your template nicely packed in an APK. Follow this procedure if you need to pack several templates in a single package, or want to add other things in the APK (for instance Zooper Widget skins).
- A. テンプレートソースパッケージのサンプルをダウンロードする
- B. 設定をLLからエクスポートし、テンプレートアーカイブを作成する
- C. テンプレートアーカイブをサンプルパッケージに放り込んで名前やアイコンなどを適用する
- D. ビルドして共有する
- E. 注意事項
A. テンプレートソースパッケージのサンプルをダウンロードする
(原文:Download the sample template source package)
Get it here. It can be imported using Android Studio or Eclipse. This sample is mostly ready to use. It already contains a default activity which will appear in your list of apps, so that tapping on it will directly start the template installation process.
A Lightning Launcher Template APK can contain one or more templates. If the package contains several templates, it will display a menu to select which one to apply.
Important: change the sample package name in the AndroidManifest.xml file, and change the name of the app (string «app_name» in res/values/strings.xml).
Very important: the package name needs to follow these rules:
- Please do not use net.pierrox in your package name
- Include lltemplate somewhere in your package name
In this tutorial we will assume the new package name is com.mygreattemplate.lltemplate
B. 設定をLLからエクスポートしてテンプレートアーカイブを作成する
In Lightning Launcher, enter the main settings screen, and select "Export for APK". This will create a «Template» archive in the LightningLauncher directory on your device (usually /sdcard/LightningLauncher/Template).
Don't forget to set the home desktop before to export !
C. テンプレートアーカイブをソースパッケージに移動する
Note: The sample package contains a sample template. You may either remove it and add your own template, or directly replace it by modifying files and names.
- First select a code name for your template. This must be a valid Java class name (0-9, A-Z, a-z, _). Let's call this template «MyGreatTemplate» for instance
- Rename the template archive from «Template» to «mygreattemplate» and move this file inside the res/raw/ directory
. The name of the file in res/raw need to be the name of the activity, but in lower case.
- Save this activity in this java file: src/com/mygreattemplate/lltemplate/MyGreatTemplate.java:
package com.mygreattemplate.lltemplate;
import android.app.Activity;
public class MyGreatTemplate extends Activity {
// nothing more to do here
}
- Edit the AndroidManifest.xml file and add a section like this:
<activity
android:name=".MyGreatTemplate"
android:label="@string/my_great_template_name"
android:icon="@drawable/my_great_template_icon"
android:exported="true">
<intent-filter>
<action android:name="net.pierrox.lightning_launcher.TEMPLATE"/>
</intent-filter>
</activity>
Finally, edit res/values/strings.xml and add an entry for my_great_template_name, and add an icon in res/drawable/my_great_template_icon.png
D. ビルドして共有する
This is up to you to build and distribute your template in any way you want, either freely or commercially.
Have fun sharing your templates !
E. 注意事項
App drawer items are excluded from the template: first for privacy reasons but also because it is unlikely that users of your template have the same list of apps. The style is kept however, but items position, folders and visibility are not kept.
Grid layouts are those that adapt the best to a large variety of screen, because items are usually sized according to a fraction of the screen size. In contrast the free mode uses absolute positions that dot not scale as well as the default grid mode. Lightning Launcher attempts to convert free layouts based on screen characteristics but it may result in unwanted deformations.
Lightning Launcher tries to help in the widget restoration process, but keep in mind this feature does not take into account widgets data and only Android 4.1+ support this feature.
最終更新:2013年12月25日 15:16