android - How to embed a wearable apk into a mobile apk using ant rather than gradle -


our company has huge complex ant build system building enormous suite of dozens , dozens of android projects built single .apk.

i incorporate wearable app don't know wearable .apk embedded within mobile .apk.

in android studio / gradle embedded automatically handled adding wear apk dependency of mobile apk within mobile's build.gradle.

does know how wear apk embedded within mobile apk when gradle not being used?

the packaging wearable apps training has of steps packaging manually:

  1. include permissions declared in manifest file of wearable app in manifest file of mobile app. example, if specify vibrate permission wearable app, must add permission mobile app.
  2. ensure both wearable , mobile apks have same package name , version number.
  3. copy signed wearable app handheld project's res/raw directory. we'll refer apk wearable_app.apk.
  4. create res/xml/wearable_app_desc.xml file contains version , path information of wearable app. example:
<wearableapp package="wearable.app.package.name">    <versioncode>1</versioncode>    <versionname>1.0</versionname>    <rawpathresid>wearable_app</rawpathresid>  </wearableapp> 
  1. add meta-data tag handheld app's <application> tag reference wearable_app_desc.xml file.
<meta-data android:name="com.google.android.wearable.beta.app"   android:resource="@xml/wearable_app_desc"/> 
  1. build , sign handheld app.

many of these steps can done single time - important step #3, in copy resulting wearable apk correct place before building app.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -