Most my apps developed by Corona work on my watch and I thought using Corona to develop apps for Android Wear. I think to make GOogle Play Platform recognise the app for wear platfrom, this is added to Android Manfest in manifest file.
<meta-data
android:name=“com.google.android.wearable.standalone”
android:value=“true” />
Is there a way to include this on Corona files to make Google recognize it as a wear app?
The AndroidManifest.xml file is a pretty complex XML beast and I don’t have a real view to where you’re putting this into the file. Can you post a complete AndroidMainfest.xml and show me where this goes?
Thanks
Rob
This is the android manifest fro the watch app (it is for a watch face app).
I think this line is also necessary
<uses-feature android:name=“android.hardware.type.watch”/>
<?xml version=“1.0” encoding=“utf-8”?>
<!–
Copyright © 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
–>
\<manifest package="com.jorc.android.wearable.watchface" xmlns:android="http://schemas.android.com/apk/res/android"\> \<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="25"/\> \<uses-feature android:name="android.hardware.type.watch"/\> \<!-- Required to act as a custom watch face. --\> \<uses-permission android:name="android.permission.WAKE\_LOCK"/\> \<!-- Required for complications to receive complication data and open the provider chooser. --\> \<uses-permission android:name="com.google.android.wearable.permission.RECEIVE\_COMPLICATION\_DATA"/\> \<!-- the following permission is required to record audio using a microphone --\> \<uses-permission android:name="android.permission.RECORD\_AUDIO" /\> \<application android:allowBackup="true" android:icon="@drawable/ic\_launcher" android:label="@string/app\_name"\> \<meta-data android:name="com.google.android.wearable.standalone" android:value="true"/\> \<meta-data android:name="com.google.android.gms.version" android:value="@integer/google\_play\_services\_version"/\> \<uses-library android:name="com.google.android.wearable" android:required="false"/\> \<service android:name=".watchface.DigitalWatchFaceService" android:label="@string/digital\_name" android:permission="android.permission.BIND\_WALLPAPER"\> \<meta-data android:name="android.service.wallpaper" android:resource="@xml/watch\_face"/\> \<meta-data android:name="com.google.android.wearable.watchface.preview" android:resource="@drawable/preview\_digital"/\> \<meta-data android:name="com.google.android.wearable.watchface.preview\_circular" android:resource="@drawable/preview\_digital\_circular"/\> \<meta-data android:name="com.google.android.wearable.watchface.companionConfigurationAction" android:value="com.jorc.android.wearable.watchface.CONFIG\_DIGITAL"/\> \<meta-data android:name="com.google.android.wearable.watchface.wearableConfigurationAction" android:value="com.jorc.android.wearable.watchface.CONFIG\_DIGITAL"/\> \<intent-filter\> \<action android:name="android.service.wallpaper.WallpaperService"/\> \<category android:name="com.google.android.wearable.watchface.category.WATCH\_FACE"/\> \</intent-filter\> \</service\> \<!-- All intent-filters for config actions must include the categories com.google.android.wearable.watchface.category.WEARABLE\_CONFIGURATION and android.intent.category.DEFAULT. --\> \<activity android:name=".config.DigitalWatchFaceWearableConfigActivity" android:label="@string/digital\_config\_name"\> \<intent-filter\> \<action android:name="com.jorc.android.wearable.watchface.CONFIG\_DIGITAL"/\> \<category android:name="com.google.android.wearable.watchface.category.WEARABLE\_CONFIGURATION"/\> \<category android:name="android.intent.category.DEFAULT"/\> \</intent-filter\> \</activity\> \<activity android:name=".watchface.MainActivity" android:label="mainactivity"/\> \<service android:name=".config.DigitalWatchFaceConfigListenerService"\> \<intent-filter\> \<action android:name="com.google.android.gms.wearable.MESSAGE\_RECEIVED"/\> \<data android:host="\*" android:pathPrefix="/" android:scheme="wear"/\> \</intent-filter\> \</service\> \<service android:name=".provider.IncrementingNumberComplicationProviderService" android:icon="@drawable/icn\_complications" android:label="@string/complications\_provider\_incrementing\_number" android:permission="com.google.android.wearable.permission.BIND\_COMPLICATION\_PROVIDER"\> \<intent-filter\> \<action android:name="android.support.wearable.complications.ACTION\_COMPLICATION\_UPDATE\_REQUEST"/\> \</intent-filter\> \<meta-data android:name="android.support.wearable.complications.SUPPORTED\_TYPES" android:value="RANGED\_VALUE,SHORT\_TEXT,LONG\_TEXT"/\> \<!-- When your complication data provider is active, UPDATE\_PERIOD\_SECONDS specifies how often you want the system to check for updates to the data. In general, you want to manually trigger updates only when your complication data actually changes via ProviderUpdateRequester (check UpdateComplicationDataService.java for an example). If you do decide to use UPDATE\_PERIOD\_SECONDS, set the interval in the order of minutes. A good value might be 600 seconds (10 minutes) if you need updates pulled often. Also, remember that this is only a guidance for the system. Android Wear may update less frequently. --\> \<meta-data android:name="android.support.wearable.complications.UPDATE\_PERIOD\_SECONDS" android:value="0"/\> \</service\> \<receiver android:name=".provider.ComplicationToggleReceiver"/\> \<activity android:name=".config.ColorSelectionActivity"/\> \</application\> \</manifest\>
See: https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#app-features
That sounds like it might cover what you need.
Rob
Thanks Rob. I got a step closer by seeing the Android Wear option; however, the option is disabled. I am fairly sure it is related to Target levels below. Is there such an option in COrona to choose these levels:
All devices that are running Wear 2.0 are using Android 7.1.1 (API level 25). If your app only supports devices running Wear 2.0 or higher, the minimum and target API level should be 25. If your app supports both Wear 1.x and 2.0, the minimum and target API level can be 23. All Wear apps must target API level 23 or higher, so run-time permissions are required.
This is my build.setting:
–
– For more information on build.settings see the Corona SDK Build Guide at:
– http://docs.coronalabs.com/guide/distribution/buildSettings/index.html
settings = { orientation = { default = "portrait", supported = { "portrait" } }, android = { usesFeatures = { { name="android.hardware.location", required=false }, { name="android.hardware.location.gps", required=false }, { name="android.hardware.type.watch", required=true }, { name="com.google.android.wearable.standalone", required=true }, }, }, iphone = { plist = { CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, }, }, }
This is my build.setting:
–
– For more information on build.settings see the Corona SDK Build Guide at:
– http://docs.coronalabs.com/guide/distribution/buildSettings/index.html
settings = { orientation = { default = "portrait", supported = { "portrait" } }, android = { usesFeatures = { { name="android.hardware.location", required=false }, { name="android.hardware.location.gps", required=false }, { name="android.hardware.type.watch", required=true }, { name="com.google.android.wearable.standalone", required=true }, }, }, iphone = { plist = { CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, }, }, }
It is strange, I got this review about the app from Google. I dont use openFile:
Hello Google Play Developer,
We reviewed Cycloop Watch, with package name com.jorc.CycLoopWatch, and found that your app uses software that contains security vulnerabilities for users. Apps with these vulnerabilities can expose user information or damage a user’s device, and may be considered to be in violation of our Malicious Behavior policy.
Below is the list of issues and the corresponding APK versions that were detected in your recent submission. Please migrate your apps to use the updated software as soon as possible and increment the version number of the upgraded APK.
Vulnerability APK Version(s) Deadline to fix
Vulnerability APK Version(s) Deadline to fix
Path Traversal
Your app(s) are using a content provider with an unsafe implementation of openFile.
To address this issue, follow the steps in this Google Help Center article.
4 November 17, 50352
To confirm you’ve upgraded correctly, submit the updated version of your app to the Play Console and check back after five hours. We’ll show a warning message if the app hasn’t been updated correctly.
While these vulnerabilities may not affect every app, it’s best to stay up to date on all security patches.
If you have technical questions about the vulnerability, you can post to Stack Overflow and use the tag “android-security.” For clarification on steps you need to take to resolve this issue, you can contact our developer support team.
Best,
The Google Play Team
What version of Corona are you using?
Rob
2017.3100(2017.6.22)
This is the message from google play developer console
Just checking it now, the app is actually available on Google Play but it says no device is supported to install.
https://play.google.com/store/apps/details?id=com.jorc.CycLoopWatch&rdid=com.jorc.CycLoopWatch
It says on Google Play:
Requires Android
4.0.3 and up
I need to comply with this though:
All devices that are running Wear 2.0 are using Android 7.1.1 (API level 25).
If your app only supports devices running Wear 2.0 or higher, the minimum and target API level should be 25.
If your app supports both Wear 1.x and 2.0, the minimum and target API level can be 23.
All Wear apps must target API level 23 or higher, so run-time permissions are required.
I added this but the app still shows 4.0.3 in Google Play.
android = { { minSdkVersion = "25",}, usesFeatures = { { name="android.hardware.location", required=false }, { name="android.hardware.location.gps", required=false }, { name="android.hardware.type.watch", required=true }, { name="com.google.android.wearable.standalone", required=true }, }, },
The path traversal error was fixed in daily build 3145. The latest public build is 3194 and the current daily build is 3224.
I would at a minimum recommend moving to 3194 through the current daily build has a few more fixes that could be better for you.
Rob
I tried the newer version Rod, but this line doesn’t seem to be implemented:
{ minSdkVersion = “25”,},
FYI, it really helps to make sure your code is formatted well and when posting to the forums, use the code formatting tools so that your line indentions are maintained. You can use the blue <> button in the row with Bold, Italic, etc. and paste your code into the popup window. This will make it easier for people to read your code. If you’re not indenting your code, it’s a lot harder to spot problems. For instance, I would think your build.settings should look like this:
settings = { android = { { minSdkVersion = "25",}, usesFeatures = { { name="android.hardware.location", required=false }, { name="android.hardware.location.gps", required=false }, { name="android.hardware.type.watch", required=true }, { name="com.google.android.wearable.standalone", required=true }, }, }, }
When you look at the formatted code you seem to have an unnamed table in the middle of the Android table. I believe the build.settings you want is:
settings = { android = { minSdkVersion = "25", usesFeatures = { { name="android.hardware.location", required=false }, { name="android.hardware.location.gps", required=false }, { name="android.hardware.type.watch", required=true }, { name="com.google.android.wearable.standalone", required=true }, }, }, }
Rob
Thanks Rob. It works fine although still I cant publish to Android wear likely to be the design requirements.
The AndroidManifest.xml file is a pretty complex XML beast and I don’t have a real view to where you’re putting this into the file. Can you post a complete AndroidMainfest.xml and show me where this goes?
Thanks
Rob