I have studied Sony Smartwatch MN2 for couples of week. I still don't get how to use their SDK to install a new apk file. The apk file is programed by me. It can work on Android phone. If someone know how and willing help me. I will be very thankful.
Here's my manifest code.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.samplepreferenceactivity2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission
android:name="com.sonyericsson.extras.liveware.aef.EXTENSION_PERMISSION"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/BaseStyle" >
<activity
android:name="SamplePreferenceActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="SampleExtensionService" />
<receiver android:name="com.sonyericsson.extras.liveware.extension.sensorsample.ExtensionReceiver" android:exported="false">
<intent-filter>
<!-- Generic extension intents. -->
<action android:name="com.sonyericsson.extras.liveware.aef.registration.EXTENSION_REGISTER_REQUEST" />
<action android:name="com.sonyericsson.extras.liveware.aef.registration.ACCESSORY_CONNECTION"/>
<action android:name="android.intent.action.LOCALE_CHANGED" />
<!-- Notification intents -->
<action android:name="com.sonyericsson.extras.liveware.aef.notification.VIEW_EVENT_DETAIL"/>
<action android:name="com.sonyericsson.extras.liveware.aef.notification.REFRESH_REQUEST"/>
<!-- Widget intents -->
<action android:name="com.sonyericsson.extras.aef.widget.START_REFRESH_IMAGE_REQUEST"/>
<action android:name="com.sonyericsson.extras.aef.widget.STOP_REFRESH_IMAGE_REQUEST"/>
<action android:name="com.sonyericsson.extras.aef.widget.ONTOUCH"/>
<action android:name="com.sonyericsson.extras.liveware.extension.util.widget.scheduled.refresh"/>
<!-- Control intents -->
<action android:name="com.sonyericsson.extras.aef.control.START"/>
<action android:name="com.sonyericsson.extras.aef.control.STOP"/>
<action android:name="com.sonyericsson.extras.aef.control.PAUSE"/>
<action android:name="com.sonyericsson.extras.aef.control.RESUME"/>
<action android:name="com.sonyericsson.extras.aef.control.ERROR"/>
<action android:name="com.sonyericsson.extras.aef.control.KEY_EVENT"/>
<action android:name="com.sonyericsson.extras.aef.control.TOUCH_EVENT"/>
<action android:name="com.sonyericsson.extras.aef.control.SWIPE_EVENT"/>
</intent-filter>
</receiver>
</application>
</manifest>
The APK is installed on the phone itself, since the SmartWatch host process runs on the device itself.
Here is a quick checklist to make it work and show it on the SmartWatch:
Download the SmartConnect (Liveware Mgr) app from Google PLAY. https://play.google.com/store/apps/details?id=com.sonyericsson.extras.liveware
Connect Smartwatch via bluetooth with the device.
Download Smartwatch host application (https://play.google.com/store/apps/details?id=com.sonyericsson.extras.smartwatch) - this will be prompted by Smartwatch when it connects
You can then go into Smartconnect app and check which applications(probably the one you created) on your device are installed for smartwatch, even discover new applications on the Google PLAY store
Please let me know if this is not clear, feel free to ask more explanation.
Won't work you'd have to spoof the watch into thinking it's talking to the app, because when the phone installs an app for the smartwatch (first generation, I still use Sony MN2) it checks to see if the app is supported by your specific watch, if it isn't than no install, if it is than it'll install automatically but it's taken me 3 years to get this far, and I can still only install the generic music player that barely functions, better off getting something that uses the new wear OS cause it's easier to deal with when making homebrew
Related
I am coding an application for Android Automotive OS. It is a simple Hello World for now, but that is not the problem of the app so far.
To run the app in the in-built automotive emulator of Android Studio (I use the Canary version of Android Studio Electric Eel | 2022.1.1 Canary 10) I had to download an app called Google Automotive App Host, gonna refer to them as GAAH from now on, to be able to run my own created app. So far so good.
Now I came across a "problem" in my AndroidManifest.xml which says:
Implement permissions on this exported component. in the <service> section:
<application
android:allowBackup="true"
android:icon="#mipmap/example_icon"
android:label="#string/app_name"
android:roundIcon="#mipmap/example_icon_round"
android:supportsRtl="true"
android:theme="#style/Theme.Example">
<meta-data
android:name="androidx.car.app.minCarApiLevel"
android:value="1" />
<service
android:name="com.example.launcher.services.LauncherService"
android:exported="true">
<intent-filter>
<action android:name="androidx.car.app.CarAppService" />
</intent-filter>
</service>
<activity
android:name="androidx.car.app.activity.CarAppActivity"
android:exported="true"
android:launchMode="singleTask"
android:theme="#android:style/Theme.DeviceDefault.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="distractionOptimized"
android:value="true" />
</activity>
</application>
Most of the answers stated, that android:exported should be set to false, which makes sense, so other apps don't have access to my own app.
The problem is, it also includes the aforementioned GAAH, which I need to be able to run it at all. It is not something game-breaking, it is just an inconvenience to deal with.
My question is: Are there ways to fix this issue and retain the ability for GAAH to run my app in AAOS?
Thanks in advance!
Grey
Edit: Expanded the XML section from <service> to <application>
The Google Automotive App Host holds the android.car.permission.TEMPLATE_RENDERER permission, so you should be able to use that as follows:
<service
android:name=(hidden)
android:exported="true"
android:permission="android.car.permission.TEMPLATE_RENDERER">
<intent-filter>
<action android:name="androidx.car.app.CarAppService" />
</intent-filter>
</service>
Additionally, you can further refine which hosts you trust by overriding the CarAppService::createHostValidator method.
I've created what I think is an android instant app. When ever I test the instant app functionality via Android Studio it works as expected. I've followed the instructions to generate the associated files for linking the instant app to a URL and placed them accordingly on my site. I've uploaded a signed bundle to a alpha closed testing track. The URL I'm using will work to launch the app. However, when I goto Settings-> Google-> Apps & Notifications and remove the instant app, the link no longer works it takes me directly to the website. I dont understand what I've done wrong as its my understanding that instant apps dont need to be preinstalled the URL should trigger I assume the play store to send over a bundle to load into memory (of some sorts). Am I correct in thinking I should be able to run an instant app with out installing it first? Any help would be appreciated. Below is my manifest file. Which I believe to be correct.
Almost identical problem to: InstantApp not being launched when clicking on link
I've tried the solution mentioned in that post. To no success.
If this description/question sucks please let me know I will try to make it better. Second post ever first got deleted I presume because it sucked? No idea. Thanks community ahead of time for your help.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
xmlns:tools="http://schemas.android.com/tools"
package="learn.instantapps">
<!-- The following declaration enables this module to be served instantly -->
<dist:module dist:instant="true"></dist:module>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:targetSandboxVersion="2"
android:theme="#style/AppTheme">
<activity android:name="learn.instantapps.MainActivity">
<meta-data
android:name="default-url"
android:value="https://mysite/main" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:order="1">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="my site"
android:path="/main" />
</intent-filter>
<intent-filter android:order="1">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="http"
android:host="my site"
android:path="/main" />
</intent-filter>
</activity>
</application>
</manifest>
This question already has answers here:
My android app is not being displayed in the app drawer?
(3 answers)
Closed 8 years ago.
Before labeling this as a duplicate, please read. I have successfully installed an Android application I developed on Eclipse on to two different platforms: one emulator (Blue Stacks) and one actual device. Like I said, the app installs just fine on both platforms, but it doesn't appear on the list of apps that can be launched. When I go to settings, I can see the app on the list of installed applications, and it lets me uninstall it, but not open it. I've spent hours trying every remedy online, but nothing works. My app is only one activity, so it should be simple, but this is the first app I've developed. I'll attach my manifest xml file below.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.teamjava.theultimatetipcalculator"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.teamjava.theultimatetipconverter.MainActivity"
android:screenOrientation="portrait" >
</activity>
<intent-filter>
<action android:name="android.intent.action.MainActivity" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</application>
You should probably try using the same package name for the app and location of your activity.
You have:
package="com.teamjava.theultimatetipcalculator"
android:name="com.teamjava.theultimatetipconverter.MainActivity"
Try
package="com.teamjava.theultimatetipcalculator"
android:name="com.teamjava.theultimatetipcalculator.MainActivity"
or
package="com.teamjava.theultimatetipconverter"
android:name="com.teamjava.theultimatetipconverter.MainActivity"
EDIT -
Also try placing the intent filter inside the activity. This is how my manifest looks on all my apps
<activity
android:name="com.example.exampleapp.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Change:
<action android:name="android.intent.action.MainActivity" />
to:
<action android:name="android.intent.action.MAIN" />
Have you checked your console in Eclipse? Sometimes, your program can compile fine, but display errors in the console on startup.
In Eclipse. Window - show view - Console
I have 2 apps:
1 - ContentProvider;
2 - Application that uses this ContentProvider.
I need to install these 2 apps using single apk file. I want to push these two apps simultaneously, in Eclipse if I add to buildpath of one app another project and add several lines in the manifest.Is it possible to install simultaneously two apps(one of them is ContentProvider) using one apk?
Is it possible to install simultaneously two apps(one of them is ContentProvider) using one apk?
No, sorry.
You may define multiple activitys, services etc in one manifest.xml. So if you were to move both of your applications into one project, and then add them both to the manifest, you can in a way install multiple apps in one apk.
Look here for more info about the manifest: http://developer.android.com/guide/topics/manifest/manifest-intro.html
However, as already pointed out, the application-tag can only occur once.
Yes it's possible to have two apps (internally activities) installed in one api.
Extending to dac2009's answer..
Here is one sample Manifest file that does this.
`<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dualapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name_people"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.dualapp.MeetPeopleActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name_people"
android:taskAffinity="com.example.dualapp.MeetPeopleActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.dualapp.MeetTechieActivity"
android:icon="#drawable/ic_tech"
android:label="#string/app_name_techie"
android:taskAffinity="com.example.dualapp.MeetTechieActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>`
Installing this puts two app icons in my mobile.
I have an app which has been deployed to Play and is compatible with any device running 2.1 or later; no special restrictions or requirements defined in AndroidManifest.xml.
There have been several complaints from users trying to install the app via Google Play but getting messages that it is not compatible. In all of these cases sideloading the app works perfectly.
Digging a little deeper into the problem it appears that in all cases, the people reporting the problem are using a device that did not ship with Google Play installed. IE. the device probably failed Google's CTS.
Having said that, they are able to install other apps via Google Play but not ours. Again, sideloading our app onto these devices works fine. Does anybody know why this might be? I assume it must be something I am doing incorrectly in AndroidManifest.xml but I see nothing suspicious.
EDIT: Here's the AndroidManifest.xml, altered to protect the names of the innocent:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.foo.bar"
android:versionCode="1"
android:versionName="#string/global_app_version">
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="10"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:label="#string/global_app_short_name" android:icon="#drawable/app">
<activity android:name=".HomeActivity"
android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter android:label="#string/global_app_short_name">
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".AActivity"
android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter android:label="#string/global_app_short_name">
<action android:name="android.intent.action.VIEW"/>
</intent-filter>
</activity>
<activity android:name=".BActivity"
android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter android:label="#string/global_app_short_name">
<action android:name="android.intent.action.VIEW"/>
</intent-filter>
</activity>
<activity android:name=".CActivity"
android:launchMode="singleTask"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="stateHidden">
<intent-filter android:label="#string/global_app_short_name">
<action android:name="android.intent.action.VIEW"/>
</intent-filter>
</activity>
<activity android:name=".DActivity"
android:launchMode="singleTask"
android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter android:label="#string/global_app_short_name">
<action android:name="android.intent.action.VIEW"/>
</intent-filter>
</activity>
<activity android:name=".EActivity"
android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter android:label="#string/global_app_short_name">
<action android:name="android.intent.action.VIEW"/>
</intent-filter>
</activity>
<activity android:name=".FActivity"
android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter android:label="#string/global_app_short_name">
<action android:name="android.intent.action.VIEW"/>
</intent-filter>
</activity>
<!-- This activity is invoked whenever an xxx is opened -->
<activity android:name=".GActivity"
android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter android:label="#string/global_app_short_name">
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.EDIT"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:mimeType="application/xxx"/>
<data android:mimeType="application/yyy"/>
<data android:mimeType="application/zzz"/>
<data android:mimeType="application/aaa"/>
<data android:mimeType="application/bbb"/>
</intent-filter>
</activity>
</application>
</manifest>
I found the culprit - Copy Protection was enabled. From Google's notes on the setting:
http://developer.android.com/guide/google/play/filters.html
To copy protect an application, set copy protection to "On" when you
configure publishing options for your application. Google Play will
not show copy-protected applications on developer devices or
unreleased devices.
In other words, having to side-load Google Play is just a side effect of being an "unreleased device" / device that fails the Google CTS. In any case, disabling copy protection resolved the issue.
Maybe the hardware they are running is not compatible with your app? Maybe you require a touch screen and they don't have it; maybe you require telephony and they don't have it?
Note that depending on your target api you might get some implicit hardware requirements.
Anyway, trying to get a log from them would be most helpful!
Maybe the affected users can try and reset the Google Play Store app on their devices:
Menu --> Settings --> Apps --> Google Play Store
Then click "Force close" and "Clear data"
Then start Google Play Store again, login, and try to install your app again.
If you have any in-app products or if you are selling the application for money then Google Play automatically filters you out of certain countries it doesn't support billing for. You can email Google to ask here.