App Creation(アプリの作成)

Introduction(はじめに)

Tasker allows creation of completely standalone apps (APK files) which have no requirement for Tasker to be installed on the device they’re used on.

The intention is to allow people to create their own apps for fun, for sale or just to share with friends. Or if you are concerned about all the permissions Tasker needs you can create an app that has only the permissions you require!

App creation is uncomplicated and takes only a few seconds once you’re setup.

To create apps, you need the following on your device (not necessarily on the device(s) the app will run on):

  • Android 2.3+
  • Tasker App Factory (free, see below)
  • a device with an ARM or x86 processor (the vast majority of devices have one of those)

App creation is accessed by long-clicking on a project (not the base project) or task and selecting Export then As App. Any linked resources needed (e.g. other tasks, images) are included as part of the new app.

To export anything except a single task, you need to create a project and put anything you wish to export in the project.

https://tasker.joaoapps.com/userguide/en/appcreation.html

Taskerを使って完全に独立したアプリ(APKファイル)を作成することができます。このようにして作成されたアプリは使用に際してその端末にTaskerがインストールされている必要はありません。

趣味または販売目的あるいはグループでの共有を目的に独自のアプリを作成してもらうほか、Taskerが求める全ての権限を与えたくないような場合に必要な権限でのみ動作するアプリを作りたいような場合に役に立つ者と考えます。

アプリの作成は簡単で設定が済めば数秒でできます。

アプリの作成に必要な条件は次の通りです(アプリの作成は作成されたアプリを実行する端末で行う必要はありません)。

  • Android 2.3以降
  • Tasker App Factory アプリ(詳しくは後説します)
  • ARM または x86 プロセッサー搭載の端末 (大多数のデバイスに搭載されています)

アプリを作成するにはプロジェクト(ベースプロジェクト以外)タブまたはタスクを長押しして表示されるメニューから「エクスポート」を選択した後「アプリとして」を選択します。アプリの作成に必要なリソース(例えば、関連するタスクやイメージ素材など)は自動的に作成されるアプリの一部として組み込まれます。

単一のタスクをエクスポートする場合を除き、プロジェクトを作成してそこにエクスポートしたいものをまとめておく必要があります。

Hello World Example(ハローワールドの例)

Let’s make a simple app that just pops up Hello World! when it’s launched.

https://tasker.joaoapps.com/userguide/en/appcreation.html

起動すると「Hello World!」の文字をポップアップ表示するだけの簡単なアプリの作成例を示します。

1. Create A Task(タスクの作成)

  • make a new task
    click on the Tasks tab then click + to add a new task. Give it a name Hello World.
  • give the task an icon
    click the grid icon at the bottom of the screen and pick any icon
  • add the Popup action
    click + in the bottom left to add an action, select category Alert and then action Popup. Fill in Hello World! in the Text parameter, then click the accept button bottom left to accept the action, then again to accept the task.
  • ask Tasker to create an app
    long-click on the task you just made, select Export then As App. A popup appears mentioning a Missing App.
https://tasker.joaoapps.com/userguide/en/appcreation.html
  • 新規タスクの作成
    タスクタブを選択した状態で+のアイコンをタップします。タスク名は「Hello World」とします。
  • タスクにアイコンを設定する
    画面の下部にあるマス目のアイコンをタップして、好みのアイコンを選択します。
  • ポップアップ表示アクションの追加
    画面の右下にある+のアイコンをタップしてアクションを追加します。「アラート」カテゴリーにある「ポップアップ表示」アクションを選択してください。「文字」の項目に「Hello World!」と入力して画面左下にある<アイコンをタップしてアクション編集画面を閉じた後、タスク編集画面も閉じてください。
  • Taskerにアプリの作成を指示
    タスクの一覧にある今作ったタスクを長押しして「エクスポート > アプリとして」の順に選択します。見つからないアプリについてのポップアップが表示されます。

    2. Install Tasker App Factory(Tasker App Factoryアプリのインストール)

    To generate apps, Tasker needs a free helper app called Tasker App Factory. It’s available on Play Store and from the Tasker website.

    Click the accept button on the popup to install the helper app.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    アプリの作成には「Tasker App Factory」という補助アプリが必要になります。Playストアまたは公式ウェブサイトから入手可能です。

    インストールボタンをタップしてインストールを開始します。

    3. App Generation(アプリの作成)

    Tasker should now start generating your app, which will take maybe 12 seconds depending on your device.

    If all goes well, the Cancel button will turn into an OK button meaning your app is ready!

    We can’t run the app straight away though because it hasn’t been installed. Click on the rightmost bottom button with the Android icon to ask Android to install your app.

    Once Android is done installing, you can click it’s Open button to run the app, or you can simply go to the home screen and click on the app’s icon in the launcher.

    You should see a Hello World popup!

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    Taskerがアプリの作成を開始します。端末ごとに異なりますが、概ね十数秒で完了します。

    問題なく作成されるとキャンセルボタンがOKボタンに変わりアプリの準備が整った事を知らせます。

    作成したアプリはまだインストールされていないのですぐに使うことはできません。Androidにアプリのインストールを指示するために一番右側にあるAndroidのアイコンのボタンをタップします。

    インストールが済むと開始ボタンをタップするか、ホーム画面からランチャーアプリにある作成したアプリのアイコンをタップして起動することができます。

    「Hello World!」のポップアップが表示されるはずです。

    App Configuration(アプリの設定)

    More usually, before an app is generated you will be presented with a configuration screen which lets you specify various options for the new app.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    通常はアプリの生成の前に設定画面が表示されアプリの作成に関する多くのオプションを指定することができます。

    App Signing(アプリの署名)

    Android requires that all apps be signed i.e. that they certify who created them. By default, Tasker uses an automatically-generated insecure certificate to sign apps and doesn’t bother mentioning it.

    However, if you want to release an app via a public site (Play Store for example), you will need to sign it with a proper (secure) certificate. That’s done so the site knows that it’s you that’s giving them the app each time you submit a new version.

    Certificates are kept in a keystore which is protected with a password. To generate a keystore with a secure certificate, use Menu / More / Developer Options / Create Certificate.

    Once you’ve generated the keystore, Tasker will often need to ask you for the certificate password before app generation so that it can be used to sign each new version of your app.

    If Android’s backup service is enabled in Android settings, Tasker makes a backup of the keystore there.

    Tasker also makes an automatic backup of the keystore to

    	/sdcard/Tasker/factory/keystore.user
    

    when it is first created and when you backup your profile data with Menu / Data / Backup. It’s highly advisable to make a copy of that file and keep it safe away from your device.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    アプリの作成者を証明するためにAndroidは全てのアプリに対して署名を求めます。デフォルトではTaskerが自動生成された安全でない証明書を確認せずに使用します。

    しかし、もし作成したアプリを公式なサイト(例えばPlayストアなど)から配布したいのであれば、ちゃんとした(安全な)証明書によって署名を行う必要があります。これはアプリの新バージョンを登録する度にサイトがアプリの作成者をあなただと確認するために署名を必要とするためです。

    証明書はAndroidキーストアシステムによってパスワードで保護されます。安全な証明書によるキーストアの生成は、メニュー > その他 > 開発者向けオプション > 証明書を作成する から行うことができます。

    キーストアが生成されると、アプリの生成を行う度にTaskerは新バージョンのアプリに署名をするためにパスワードを求めます。

    AndroidのバックアップサービスがAndroidの設定によって有効になっている場合、Taskerはキーストアのバックアップをそこに作成します。

    また、Taskerはキーストアの自動バックアップを

    /sdcard/Tasker/factory/keystore.user

    に保存します。

    メニュー > データ > バックアップする から最初のバックアップを作成したときには、バックアップファイルのコピーを端末ストレージの安全な場所に保存しておくことを強くお勧めします。

    Target Device Requirements(対象端末の要件)

    The device the child app is used on must meet the following requirements:

    • the minimum SDK version specified in the Kid Config screen
    • have hardware corresponding to features specified in the Kid Config screen
    https://tasker.joaoapps.com/userguide/en/appcreation.html

    作成したアプリを実行する端末の要件は次の通りです。

    • Kid Config画面で指定されているSDKの最低要件
    • Kid Config画面で指定されている要件をハードウェアが満たしていること

      (※訳者注:Kid Configが何の設定なのか調べてもよく分かりませんでした。文脈から推測すると子アプリ作成時に表示される要件設定画面のことだと思われます。)

    Miscellaneous(その他)

    Accessibility Service(ユーザー補助)

    Android accessibility support changed in Android 4.1 (JellyBean). If support is needed for accessibility services in 4.1+, the Minimum Android Version in the child Configuration screen must be set to 16 or higher. If support is required pre-4.1, it must be set to less than 16.

    In other words, to support both pre- and post-4.1 devices, two APKs must be generated.

    This applies to all features that rely on an Accessibility Service (events Notification, New Window, Button Widget Clicked, Notification Click, variables %NTITLE, %WIN, App Context from min version 20+)

    Google Play Store allows publication of APKs targetting different Android versions under the same package name, however this has not been tested by the developer of Tasker.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    Androidのユーザー補助機能はバージョン4.1(JellyBean)から変更されています。バージョン4.1以降のユーザー補助機能のサポートが必要な場合、子アプリの設定画面のAndoroidの最低バージョンの項を16以上に設定する必要があります。バージョン4.1よりも前のサポートが必要な場合は16未満に設定する必要があります。

    これはすなわち、バージョン4.1以降とそれよりも前のバージョンに対応する場合には二つのAPKファイルを作成する必要があると言うことです。

    これはユーザー補助機能に関連する全ての事柄に適用されます(イベント:「通知が表示された」、「新しいウィンドウが表示」、「ウィジェットボタンをクリック」、「通知をクリックした」、変数:「%NTITLE」、「%WIN」、バージョン20以降のアプリケーションコンテキスト)。

    Google PlayストアではことなるAndroidバージョンのAPKの発行を同じパッケージ名で行うことを認めていますが、これはTaskerの開発者によって確認されているわけではありません。

    Launch Task(タスクの呼び出し)

    When the specified launch task runs in the child app, the following local variables will be available to it:

    • %launch_data: the data (URI) in the intent that caused the child app to launch (often empty)
    https://tasker.joaoapps.com/userguide/en/appcreation.html

    子アプリで指定されたタスクの起動が実行された場合、以下のローカル変数が使用可能です。

    • %launch_data
      子アプリによってはインターネット上のデータを表すURIを格納します(空の場合もあります)。

    Monitor Service(サービスの監視)

    Most child apps include a service which constantly monitors for events. If you know that you don’t need to monitor events anymore (in-between app launches) you can use the Disable action in the Tasker category to stop it.

    It will be automatically started again next time the app is launched.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    ほとんどの子アプリにおいてイベントの常時監視が行われます。イベントの監視が(アプリの起動中に)必要ない場合は、Taskerカテゴリーの無効化アクションを使って停止することができます。

    次回のアプリ起動時には自動的に監視が再開されます。

    Mostatically started again next time the app is launched.

    Widgets / Shortcuts(ウィジェット / ショートカット)

    • it’s not possible in Android to auto-create widgets with any app
    • it’s not possible *currently* to offer the user child-app widgets, that may be available in the future to some extent
    https://tasker.joaoapps.com/userguide/en/appcreation.html
    • Androidではどのようなアプリのウィジェットも自動で作成することはできません。
    • 現時点においてはユーザーが作った子アプリをウィジェットにすることはできませんが、将来的にはある程度可能になるかもしれません。

    Memory Problems(メモリー問題)

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    アプリの作成中にメモリー不足が問題になる場合、作成のプロセスに外部メモリーを使用することをApp Factoryに対して指定することができます。メニュー > Tasker基本設定 > その他 > ファクトリーをご覧下さい。(※訳者注:現在メニュー内にファクトリーという項目は見当たらない様です。)

    Preferences(設定)

    The new app does not take over any preferences from Tasker, all of the preferences in the child app are in their default state, with a couples of exceptions.

    Despite the misleading name, you can use the Set Tasker Pref action in the Tasker category in the child app to change some of the child’s preferences when it is running.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    新しいアプリはTaskerからはどのような設定も引き継ぐ事はありません。子アプリの設定はいくつかの例外を除いて標準の設定になります。

    紛らわしい名前ですが、子アプリ側でTaskerカテゴリーの「Taskerを設定」アクションを用いて実行中の子アプリの設定を変更することができます。

    Available Tasker Features(使用可能なTaskerの機能)

    Obviously, the device the new app runs on may not have the same set of available e.g. actions as the device the app is created on.

    The Test action in the Misc category allows you to check which Tasker features are available at run time (when the app is being used).

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    新しいアプリを実行する端末が必ずしもアプリの作成に使った端末と同じアクションを実行できるとは限りません。

    その他カテゴリーの「調査」アクションを使って実行時(アプリが使用された際)にTaskerの機能が有効かどうかをチェックすることができます。(※訳者注:この調査アクションはTaskerカテゴリーにある「Taskerの調査」アクションのことだと思われます。)

    Images(画像)

    Referenced images (even scene doodles and photos from internal storage) are bundled in with the app.

    Tip: to include a dynamic image (e.g. which you download to a file path via HTTP Get), put the image reference in a variable, and put the variable in the relevant action.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    画像データの参照(シーンの落書き要素や内部ストレージから写真を使用しするなど)はアプリに組み込まれます。

    一口メモ:動的なイメージの取得(例えば、HTTP Getアクションなどで指定したファイルパスからダウンロードする場合など)をするには、画像への参照を変数に格納してその変数を関連するアクションで使用します。

    Plugins(プラグイン)

    When the new app is launched, it checks that all referenced plugins are installed on the device and prompts the user to install missing ones.

    Some plugins may not work on other devices if they themselves store something about the action to be performed, since that data will not be available on the other device.

    Plugin authors: see also here.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    新しいアプリを起動すると、その端末に必要なプラグインが全てインストールされているかどうかがチェックされ、足りないものがある場合には警告が出ます。

    実行するアクション内で必要な何かしらのデータが端末内に存在しない場合、そのプラグインが動作しない事があります。

    JavaScript actions(JavaScriptアクション)

    Scripts referenced by a JavaScript action are packaged with the new app and run directly from there.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    JavaScriptアクションによって参照されているスクリプトは新しいアプリに取り込まれてそこから直接実行されます。

    SL4A Scripts(SL4Aスクリプト)

    Scripts referenced in a Run Script action are packaged with the new app and unpacked to /sdcard/sl4a/scripts, prefixed with the package name, on first run. Tasker automatically inserts the WRITE_EXTERNAL_STORAGE permission for that purpose.

    If SL4A is missing on the target device, the new app will prompt the user to download when launched.

    If a new version of the app is reinstalled on the target device, the new versions of the scripts will be written if the length has changed.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    Run Script(※訳者注:現行バージョンではRun SL4A Script)アクションが参照するスクリプトは新しいアプリにまとめられ、初回の実行時に/sdcard/sl4a/scriptsフォルダにパッケージ名をプレフィックスとするファイルとして展開(unpacked)されます。このためにTaskerはWRITE_EXTERNAL_STORAGEパーミッションを自動的に挿入します。

    目的の端末からSL4Aスクリプトが失われた場合は、新しいアプリはユーザーに対して起動時にダウンロードを促します。

    目的の端末に新しいバージョンのアプリがインストールされると、スクリプトはその長さが変更されている場合に再度書き込まれます。

    Other External Components(その他の外部コンポーネント)

    The following external components are also checked for on launch of the new app where necessary:

    • Speech engines (Say, Say After)
    • APNDroid (Mobile Data APN)
    • Zoom (Zoom action category actions)
    • apps for 3rd Party actions
    • apps for 3rd Party events
    https://tasker.joaoapps.com/userguide/en/appcreation.html

    次の外部コンポーネントも必要であれば起動時にチェックされます。

    • 読み上げエンジン(読み上げアクション、Say Afterアクション)
    • APNDroid(モバイルデータAPNアクション)
    • Zoom(Zoomアクションカテゴリーの各アクション)
    • 他社製カテゴリーの各アクションに必要なアプリ
    • 他社製イベントに必要なアプリ

    Maps(マップ)

    The data for Maps is provided by Google and they require a maps key (v2) for each developer that uses it. If you are using Map scene elements in your app, you need a key from Google that can be included with your app.

    Here are the steps to acquire a key:

    1. [if necessary] setup a Google Account
    2. [if necessary] create a developer account
    3. [if necessary] create a signing keystore
    4. get the SHA1 fingerprint of your certificate: Menu / More / Developer Options / Certificate Checksum
    5. Create an Google API Project
    6. Obtain the Maps key

    Enter the key in the App Configuration screen when generating your app. Note that the box will only be presented if your app uses one or more Map scene elements.

    Note that the device on which the created app is used needs Google’s Play Services APK installed, otherwise the map elements will not function.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    Mapで必要なデータはGoogleから提供され、各開発者がMap機能を使うためにmapsキー(v2)が必要となります。シーン要素としてMapを使用する場合に必要とされるキーはGoogleから割り当てられ、新しいアプリに含まれます。

    次にキーの取得方法を示します。

    1. (必要であれば)Googleアカウントを取得します。
    2. (必要であれば)開発者アカウントを作成します。
    3. (必要であれば)署名キーストアを作成します。
    4. 証明書のSHA1のフィンガープリント(公開鍵)はメニュー > その他 > 開発者向けオプション > 証明書 > チェックサムから取得できます。
    5. Google APIプロジェクトを作成します。
    6. Mapsキーを取得します。

    アプリを作成したら設定画面でキーを入力します。入力ボックスはシーンで1つ以上の地図要素を使用している場合にのみ表示されます。

    アプリの作成に使用した端末にGoogle Play サービス APKがインストールされていないと地図要素が機能しないので注意してください。

    Variables(変数)

    The new app is completely independent of Tasker, so it also does not share any variable values.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    新しいアプリはTaskerから完全に独立しています。したがって、いかなる変数の値も共有することはありません。

    Permissions(許可)

    Tasker attempts to reduce the set of permissions required by the new app to the smallest set required for the functionality it contains. For example, no Vibrate permission will be requested if there is no vibrate action used.

    The WAKE_LOCK permission is unfortunately always required for technical reasons.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    Taskerは新しいアプリに含まれる機能に必要な許可のセットが最小限になるように試みます。例えばバイブ(振動)アクションが使用されていない場合にはそのための許可を求めません。

    WAKE_LOCKの許可は技術的な理由により常に必要とされます。

    App Size(アプリのサイズ)

    Generated apps are minimally around 640K but are unlikely to be significantly larger unless a lot of images are referenced. It’s possible that this minimum can be reduced in the future.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    作成されるアプリのサイズは最小で概ね640Kバイト程度ですが、まれに多くの画像を含む場合などに大幅に増える場合があります。

    Encryption(暗号化)

    Code for encryption is included in any app created by App Factory, however if you don’t use encryption features it’s unlikely to be a problem in terms of export restrictions. However, that is an opinion, it is not legal advice.

    Note that code libraries for encryption are included with every Android device. Tasker (and child apps) use these libraries to perform the encryption, they do not contain encryption code themselves.

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    App Factoryで作成されるアプリには暗号化のコードが含まれますが、暗号化の機能を使用しない場合には輸出規制に関して問題になる事はほとんどありません。ただし、これはたんなる一見解に過ぎず、法的なアドバイスではありません。

    暗号化に関するコードライブラリはどのAndroid端末にも含まれます。Tasker(とその子アプリ)は暗号生成にこのライブラリを使用するため、暗号化コードそのものは含まれません。

    Licence(ライセンス)

    You are free to distribute and sell apps created by Tasker in any way you wish. No licence fees to the developer of Tasker are necessary. It would be courteous to reference Tasker and it’s website (http://tasker.dinglisch.net) somewhere in your new app if possible.

    Please note that use of images from some Ipacks in commercial software is prohibited by the licence terms of the image creators. You will need to contact the image designer to request their assent in such cases. (the origin of an Ipack’s images is displayed in the Ipack image selection screen).

    https://tasker.joaoapps.com/userguide/en/appcreation.html

    Taskerで作成したアプリはどのような方法での配布または販売も自由です。Taskerの開発者に対するライセンス料は発生しません。できれば作成されたアプリ内のどこかにTaskerまたはその公式ウェブサイトへのリンクを設けてもらえるとありがたいです。

    アプリ内で使用しているIPackなどのアイコンセットなどから画像を使用している場合、画像の著作権侵害になるため販売目的での使用はできません。このような場合は画像の制作者に直接使用許可を取る必要があります。(IPack画像の提供元はIPack画像の選択画面に表示されます。)