I've got an existing Android app that I'd like to provide a wear 2.0 complication for. I do not wish to create a custom Wear Watch Face nor a companion Wear app - I simply wish to be able to create a complication that users should be able to add to an existing watch face. Is this possible? Reading the documentation it seems to me that I would need to create a custom Watch Face or an app in order to provide a complication. I'm now a little confused. Any directions on this would be appreciated.
You don't need to develop a watch face, but you do need an app running on the watch to deliver a complication. It doesn't need any other UI (such as an Activity) unless your complication requires it for configuration, but the ComplicationProviderService does need to be in an APK running on the watch.
Related
I am just getting back into Android programming after a while and I know that separate Android applications are allowed to communicate with each other in some capacity, but is it possible for one to build a proprietary application that can modify the features of an already existing application?
I don't mean applications like those 3rd Instagram applications (which were most likely built using their api ). I mean is it possible to create an application that would for example run in the background and possibly add features on already existing applications?
For example making an extension application for that runs in the background when you use the Twitter application that could potentially add features, or disable existing features?
(Sorry if this is not directly relevant I did not know where else to post this question)
In android apps are sandboxed.
It will be a major security issue if one app could influence the operation of other apps.
What can be done is letting apps interact with each other and exchange information, there are couple of ways to do this that relay on android Inter process communication, Android Binder Content providers and Intents.
What you can do is to draw on other apps. this will allow you to add some functionality without really changing anything in the background app
There are some apps that use this technique. LastPass is a good example.
See this article for more information
If I want to integrate Android Wear into my app, do I need to rewrite the whole app for the Wear Device or can the App on the wear device use the SharedPrefs, functions and so on from the "normal" Device?
Is there a good tutorial for that?
You should consider app for Android Wear device as a separate app (it's inside separate apk bundled in parent apk i.e actual Android app) that communicates with your master Android app on the device. It's run directly on the wearable device and does not have direct access to things like SharedPreferences. Of course you can implement such access using Data Layer API.
I'd recommend you to start from Android Wear official developer guide: https://developer.android.com/training/building-wearables.html
I am new in Android wearable app development and recently I came to know that Watch Face API is also now available for Android. So I want to develop wearable app of my mobile app and also I want to develop watch face of that same app.
Can anyone suggest me is this possible or not? As I know that the layout file of wearable app and watch face are same (activity_main.xml). So how can I develop design of watch and wearable app?
I am stuck with this confusion. Please let me know the feasibility.
Thanks in advance.
For creating a watchface you need to create a service using CanvasWatchFaceService class
Watch faces in Android Wear are implemented as services. When a watch
face is active, the system invokes the methods in its service when the
time changes or when an important event occurs (like switching to
ambient mode or receiving a new notification). The service
implementation then draws the watch face on the screen using the
updated time and any other relevant data.
You may follow this https://developer.android.com/training/wearables/watch-faces/designing.html step by step to create your watchface
For wear development, refer to the following:
Creating and running a wearable app
You can run a debug wearable app over bluetooth by following this reference:
Debugging over bluetooth
If you want to test your app on the android wear handheld application, you will need to build a signed release apk and upload it to your mobile device.
For this procedure, read the following:
Assuming you use android studio:
Your mobile build.gradle file should have the following dependency:
dependencies {
...
wearApp project(':wear')
}
Go to Build > Generate signed apk. In the first window, select mobile as your module.
Now when the build is complete, the wear module will automatically be embedded into the mobile module. The mobile apk is the one you distribute. Wear can be used for testing.
I need a device that runs only one custom application and does not allow the Users to access any other features. Building a complete device would involve a lot of time and money for sure(only if this can be done with android). This can usually done for each android device seperately. It could be better if there could be simply a piece of code that can be simply executed on the device that installs the application and at the same time restricts the device as per requirement.
Could someone advice me a way to implement in the Android devices. Is it something possible :(
Would also like to know if the same is possible with iOS..
Thanks..
If you want to be absolutely sure that users cannot do anything but accessing one specific app, the only way to do this is to create a custom ROM that allows to install your app only.
I've already built a phonegap application and want to extend its functionality, so that on a SmartWatch users could view text that is generated from an XML file.
There is smartwatch SDK for native android. Its written in Java.
What are the steps necessary to package the SmartWatch functionality that I need into a Phonegap Plugin and what files from the SmartWatch SDK do I need?
You'll need to write a Phonegap plugin, to wrap the native Java calls so that you can access them from Javascript.
http://wiki.phonegap.com/w/page/36752779/PhoneGap%20Plugins
[Improved Answer]
Actually you'll have to write Java code if you want to have an app on the watch itself. Realize that you will have a number of components that need to talk with one another.
Your app using Phonegap with the intent plugin to communicate with the Sony LiveWare manager.
The Sony LiveWare manager which will communicate and deploy custom watch apps to your watch. Watch apps use Sony's Java framework so it appears that 'watch apps' live in both the LiveWare manager and the watch itself.
The custom watch app 'running' on the Smartwatch. The app will know how to display your data and/or respond to touch events.
You may be able to find an existing app which will take intent data and display it on the watch. Then all you have to do is fire off an intent with the info you wish to display on the watch to the LiveWare manager which will route the data appropriately.
If you still want to build a custom app for the watch, you'll have to go down the Java route. They do include a simulator so you don't need a watch to try.