Integrating Android Wear - android

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

Related

Pass string from Android App to Wear Os App

I am an Android Developer. I need to develop an Wear Os app that can display the text from android app that i build. May i ask any Example because i cannot found any of the Bluetooth communication example on this and is it possible?
To sync data between a phone and a Wear OS watch, you don't use Bluetooth directly. The simplest way to do this is with Wear's Data API; step-by-step documentation is here: https://developer.android.com/training/wearables/data-layer/accessing (and there's a link to an example on that page).

Developing app for Amazon Fire TV Stick?

I want to develop application for the Amazon fire stick but I am not aware of it. I am unclear about some points
Can we create a standalone app that can run into the Amazon fire stick without need to Android phone or tablet?
If we can create the standalone app then can we call web-service to retrieve data from the server?
It would be great help if you can help me to clear with these questions.
Can we create a standalone app that can run into the Amazon fire stick without need to Android phone or tablet?
Yes. It is a first-class Android device on its own.
If we can create the standalone app then can we call web-service to retrieve data from the server?
If you hold the INTERNET permission and the device has suitable connectivity, then yes. This is no different than any other Android phone, tablet, TV, or toaster.

How to develop watch face with wearable app in android?

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.

With the actual Android Wear SDK I can only develop notification related Apps? Or there is more?

I just wanted to know if right now Android Wear is only limited to notifications from apps from other device...There is very poor info on the Google Developer portal for Android Wear and can't get any straight answer from any other question. Thanks in advance.
Now, there is more. :)
You can still use customized notifications (now via the NotificationCompat.WearableExtender class) so that they are more useful on drawables.
But in addition, API level 20 is Android 4.4W, and it allows developing Wear applications with very much the same stack as standard Android apps (i.e. Activities, Services, Layouts, Views, &c) although the Design and UI are logically very different. An unofficial library provides custom views (such as CardFragment, WearableListView, &c) that help in this regard.
When developing applications, you can install them directly into the Android Wear device, but for final users the Wearable app must be embedded into the standard application, and it will be automatically pushed to the wearable after the app is installed. Android Studio helps with these parts.
There is also an API to facilitate communication between an app installed on the Wearable and its corresponding app on the handheld device. See Sending and Syncing Data in the documentation.
In short, you should start by checking the documentation on Building Apps for Wearables, and then creating a New Project in Android Studio and marking the "Wear" checkbox.
OLD ANSWER (pre I/O, now deprecated)
That is correct. As of today (June 13) the Developer Preview only supports notifications (plus some Wear-specific add-ons such as pages and voice replies).
From http://developer.android.com/wear/preview/start.html
With the Android Wear Developer Preview, you can:
Run the Android Wear platform in the Android emulator.
Connect your Android device to the emulator and view notifications from the device as cards on Android Wear.
Try new APIs in the preview support library that enhance your app's notifications with features such as voice replies and notification
pages.
Installing apps directly on the Wear emulator is not supported. It's very likely that Google I/O will bring news on this front, but just speculation at this point.
The situation is more or less similar to what happened with Google Glass, before the introduction of the GDK.
For the official SDK as per this question on Android Wear Developers Google+ page:
You can use the same notification APIs on the wearable that you use on a phone by writing an android wear app. If you need to trigger that notification from the phone, you can use the Wearable apis in Google Play Services to send messages to trigger them.

Adding Smartwatch Java extension to a Phonegap App?

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.

Categories

Resources