Coming Soon - Android Wear Notifications (Updated with Eye Candy)

barx

Well-Known Member
Licensed User
Longtime User
This looks great, you have worked really really really hard and the results speaks for themselves, cheers.

I'm personally not looking for notifications as such at the moment though, but for a way create clock faces, but oh well :)

Your work so far is excellent, I too will be willing to donate to your watch fund, I'm sure I will use those notifications sooner rather than later...

New LG G watches £145 delivered :)
http://www.amazon.co.uk/gp/aw/ol/B00LB2ZQ3C/ref=mw_dp_olp?ie=UTF8&condition=new


Thank you for your kind comments. I too am interested in creating watch faces so keep us up to date, I had a quick look the other day and couldn't find any info on how to create them....

As for the Watch, I have managed to get my grubby mits on a device. Thanks, although if you do eventually use the library once released and make some ££'s from it. By all means drop a little donation ;). I'm not particularly looking to make loads of money, just cover my b4A license and such things needed for development like this watch. Luckily people have helped me out in both instances. All I can say is Android Auto will be released soon...... LOL

In all seriousness, Auto notifications (which I'm assuming will be used) should be very similar to Wear but with a different extender.
 

Peter Simpson

Expert
Licensed User
Longtime User
Hiya @barx ,
I'm itching to get one of my apps onto Android Wear(watches), it's extremely unique(only 2 on the play store). So if I can get it onto watches then I will be happy with that. I've also got a nice watch face that would be great to get onto watches, but there's no way to embed wear apps into handheld/tablets apps in B4A as yet :(

I'm sure that it will come sooner rather than later though :D
 

barx

Well-Known Member
Licensed User
Longtime User
Hiya @barx ,
I'm itching to get one of my apps onto Android Wear(watches), it's extremely unique(only 2 on the play store). So if I can get it onto watches then I will be happy with that. I've also got a nice watch face that would be great to get onto watches, but there's no way to embed wear apps into handheld/tablets apps in B4A as yet :(

I'm sure that it will come sooner rather than later though :D

As Erel as mentioned somewhere else, i also think b4a can also already support apps on the Wear devices to an extent, I accidentally run one of my apps in b4a and it installed on the emulator, The activity failed to run but this is probably because it did something that the Wear device didn't support in it's sdk, but it installed. Therefore I think b4a just needs tweaking to allow the wear apk to be packaged inside the main apk. not sure how this is done but I think it is a job for @Erel. There will probably also be a need for a library for the unofficial UI library. Again, not sure what of the existing views are supported.
 

Peter Simpson

Expert
Licensed User
Longtime User
Package Wear APK Manually
It's still possible to package the wearable app into the handheld app manually if you are using another IDE or another method of building.

1. Copy the signed wearable app to your handheld project's res/raw directory. We'll refer to the APK aswearable_app.apk.

2. Create a res/xml/wearable_app_desc.xml file that contains the version and path information of the wearable app. For example:

The package, versionCode, and versionName are the same values specified in the wearable app'sAndroidManifest.xml file. The rawPathResId is the static variable name of the APK resource. For example, for wearable_app.apk, the static variable name is wearable_app.
B4X:
   <wearableApppackage="wearable.app.package.name">
   <versionCode>1</versionCode>
   <versionName>1.0</versionName>
   <rawPathResId>wearable_app</rawPathResId> </wearableApp>

3. Add a meta-data tag to your handheld app's <application> tag to reference the wearable_app_desc.xmlfile.
B4X:
<meta-dataandroid:name="com.google.android.wearable.beta.app"
                android:resource="@xml/wearable_app_desc"/>

4. Build and sign the handheld app.


Turn off Asset Compression
Many build tools automatically compress any files added to the res/raw directory of an Android app. Because the wearable APK is already zipped, these tools re-compress the wearable APK and the wearable app installer can no longer read the wearable app.

When this happens, the installation fails. On the handheld app, the PackageUpdateService logs the following error: "this file cannot be opened as a file descriptor; it is probably compressed."

Android Studio doesn't compress your APK by default, but if you are using another build process, ensure that you don't doubly compress the wearable app.
 
Last edited:

barx

Well-Known Member
Licensed User
Longtime User
Sorry guys I know a hand full of people are eager to get this library but I haven't had any time to work on it for last couple of days, still needs a bit of testing. Going on vacation at the weekend for a couple of weeks and so should get a bit of time to work on it then ;)

At the moment though, it's eat, sleep, work, repeat.....
 

barx

Well-Known Member
Licensed User
Longtime User
Well to the wife and kids won't let me play (code) whilst the sun is shining. Today was supposed to be a thunder storm so I was going to whip laptop out and spend a couple of hours coding. No such thunder storm has turned up so......
 

barx

Well-Known Member
Licensed User
Longtime User
Back off vacation now and I didn't get the time I thought I would whilst away to work on the library so I apologize for it taking longer than expected. I think the lib is now complete and I have done a few tests. I am now updating the demo app (which is also what I use for testing) and then I will release. Hopefully shouldn't take too long now. Then I'm going to look into the procedure of getting apps on the Wear Device...
 

aaronk

Well-Known Member
Licensed User
Longtime User
I think I have worked out how to develop for Android Wear.
I was using Android Wear (4.4W) on the Android AVD and when I complied my app it come up on the Android Wear AVD.

However, I didn't know if this is how I should be writing Android wear apps.

The next thing was how to put the wear app onto the wear device. It says on the Google developer site to include the wear APK inside the main APK that you want to put on your wear device. Which from what I see is easy to do (just use the 'Add Files' button in the IDE under files on the right). But then how do you send the wear app to the wear device when your main app is running. This is the part that got me.

Then the next bit was how do you then send data between the wear app and main app when you do get it on the wear device.

I would love to know how to do this, since I would like to start displaying data in a native app.
By the way the beta version of the Android Wear Notifications lib has been working great and haven't seen any issues yet while testing.
 

MaFu

Well-Known Member
Licensed User
Longtime User
The next thing was how to put the wear app onto the wear device. It says on the Google developer site to include the wear APK inside the main APK that you want to put on your wear device. Which from what I see is easy to do (just use the 'Add Files' button in the IDE under files on the right). But then how do you send the wear app to the wear device when your main app is running. This is the part that got me.
You should read this: https://developer.android.com/training/wearables/apps/packaging.html#PackageManually
And on top of this site:
If packaged properly, when users download the handheld app, the system automatically pushes the wearable app to the paired wearable.
 

barx

Well-Known Member
Licensed User
Longtime User

barx

Well-Known Member
Licensed User
Longtime User
Sneak peek of what new things are coming. Left the descriptions out to keep things interesting lol.

NOTIFICATION BUILDER V3

CHANGES:

NOTIFICATIONCUSTOMLAYOUT CLASS - NEW METHOD

* SetClickEvent

NOTIFICATION BUILDER CLASS - NEW METHODS

* Group
* GroupSummary
* LocalOnly
* SortKey
* Extend

NEW CLASSES
NotificationWearExtender (used to extend the notification with Wear device specific methods):

* AddAction
* AddPage
* ClearActions
* ClearPages
* (Set/Get) Background
* (Set/Get) CustomContentHeight
* (Set/Get) CustomSizePreset
* (Set) ContentAction
* (Set) ContentIcon
* (Set) ContentIconGravity
* (Set) ContentIntentAvailableOffline
* (Set) DisplayIntent
* (Set) Gravity
* (Set) HideIcon
* (Set) ShowBackgroundOnly
* (Set) StartScrollBottom

NotificationRemoteInput (used to create a remote input (voice) action:

* GetRemoteInput
* (set) Choices
* (set) Label

think that's everything....
 
Top