Android Wear: custom apperance for notification - wear-os

How to implement such appearance for notification card using Android Wear SDK?
Demo video — http://youtu.be/tKoQatxG0_8?t=26s
It has the same custom layout in preview and active mode. But I cannot achieve such behaviour using setDisplayIntent and related API for creating custom layouts. I checked samples of wear apps from SDK, it also has different views for preview and active mode of custom layout notifications.

Oh no!
Right now it's hidden API, so Google can make such appearance for standard apps, but other third-party developers are out of the board.
Confirmed by +Wayne Piekarski — https://plus.google.com/u/0/+BenoitBoDLubek/posts/2o4SVBhWg5z
So the answer is impossible at current moment.

Related

Develop custom Android Power Menu widgets

Is it possible to develop Android 11 widgets that appear on the Power Menu, exactly like Google Pay's card list?
So far I have discovered that there are a few useful guides on Device Controls, a feature that is very well suited for domotics and automation. For example the official article on Device Controls shows a fully fledged Power Menu with credit card swiping and domotics control.
I am interesting in developing a custom open source widget to browse fildelity (barcoded) cards. I have seen that the Quick Access Wallet feature is the one to use to display payment methods as swipable cards, but I have good reasons not to follow that road. First, it is designed for payment applications who hold NFC permissions, and secondarily it will disable Google Pay as default payment application for those who use it (and those who use another payment service will experience the same problem).
And Device Controls are templated and suited to be displayed in the Google Home's designated area.
So I'd like to ask if there are Android APIs to implement a fully customized widget to appear in the power menu. Of course I can kindly ask user for any permission necessary.
I start from the assumption that Google Pay itself is an application developed on top of Android framework, and has little to no special permission/policy-exception/whitelist from the OS, along with other payment applications.
I'd like to ask if there are Android APIs to implement a fully customized widget to appear in the power menu
Not in Android 11, at least in terms of public APIs.
I start from the assumption that Google Pay itself is an application developed on top of Android framework, and has little to no special permission/policy-exception/whitelist from the OS, along with other payment applications.
That is a very generous assumption. IMHO, do not assume that you can do anything that is being done by Google or the manufacturer of the device you are trying.

How to adjust layouts in xamarin.forms so that it can fit into any phone

Hi I am working on a xamarin.forms cross platform app and I am not able to get proper UI If I check the same app on other phone there is misalignment in the buttons.Is there any code that can be used so the buttons look fine in all phones ?
Thanks
Making a responsive mobile app UI could actually be a challenge somehow. These two links however, might be helpful:
Adaptive UI with Xamarin.Forms
Tips for Building Adaptive Xamarin.Forms Apps

Display app icon on top of all window in android wear?

I am developing an wear app, i want the app icon to be display on top of window
above the watch face. I have tried using WindowManager but failed to get the
result.
WindowManager.LayoutParams params=new
WindowManager.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_PHONE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT);
params.gravity= Gravity.CENTER|Gravity.CENTER;
params.x=160;
params.y=160;
windowManager=(WindowManager)getSystemService(WINDOW_SERVICE);
windowManager.addView(mfloatview,params);
my question is it possible to add an floating app icon in android wear?
I'm not sure if this feature (Display app icon on top of all window) is available. But you can try checking the documentation - Watch Face Complications.
A complication is any feature in a watch face that displays more than hours and minutes. For example, a battery indicator is a complication. The Complications API is for both watch faces and data provider apps.
Just like this:
Since you are using Android Wear 2.0, Complication API will be available for use.
Hope this helps.
I tried this one and works for android wear also...
apply same concept to wear, it works
http://www.androidhive.info/2016/11/android-floating-widget-like-facebook-chat-head/

How can Xamarin be used to wrap a web app as if it were a native app for Android?

Say I build a super mobile friendly web application that I want in the Play Store for Android users to be able to download.
Could I use Xamarin to:
Wrap the entire mobile app as a single WebView
Register for mobile push notifications
Essentially shortlining an MVP of an android app by using an existing web app? If so, is there any well-known process or documentation that demonstrates this?
Probably the best approach for you would be using Xamarin Forms with one or more pages containing only web views.
I don't love Xamarin Forms because usually for me Xamarin Android+iOS gives a better result in similar time, but your app would be so simple that doesn't make sense to do it with Xamarin Android.
Make sure that your web app will show only what makes sense to be shown in your app, otherwise you risk to see double header/footer, useless buttons... but if the website is yours adding a few parameters to change a bit the UI won't be a problem I guess.
Have a look at this example:
https://github.com/xamarin/xamarin-forms-samples/tree/master/WorkingWithWebview
Another approach is the use of Razor to build your pages in html directly inside your app, but if I understood well it's not what you need:
https://developer.xamarin.com/guides/cross-platform/advanced/razor_html_templates/
Although it is technically possible to do this as the previous answer has suggested. I would recommended firstly reviewing, the relevant stores guidelines on submissions. Apple for example will not allow a submission to their store of any application that simply mirrors the functionality of a website. I suspect Google's would likely be the same.
However that said, to answer your question, Xamarin.Forms would be appropriate for a simple application like the one you are suggesting. Or if you prefer to build to a specific OS, then in iOS with Xamarin you would use the Safari View Controller that was added in it's xcode 8.1 release. Android uses something similar as does windows.
EDIT:
You can use the Web View control in Xamarins Andorid native PCL project to encapsulate your mobile friendly website within an application here is the documentation:
Xamarin Android Developer link to Android Web View
As for push notifications, yes this is perfectly possible using Xamarin.Android. and varies on implementation depending on what you want to use as the back end to handle them, I.E. Azure's notification hub etc.

Custom Color action buttons, transparent card background,full screen custom layout notifications.Changing card color

Custom Color action buttons, transparent card background,full screen custom layout notifications.Changing card color,ttf fonts for texts. changing text color . placing on different areas.
are these things possible ??
if its , why we cant use .
if its not how these peoples used these things
I really wanted to develop apps with these features. but current public api is really bad.
it provides nothing at all.but when we see screenshots new beautiful features exists.
I liked google wear and i see future about it . but when we compare with samsung galaxy gear or sony smartwatch, development in public goes slow.Maybe google devs doing things at the background,but if we don't have resources,how can developers can build apps for it.
I shared a basic app with my wishes and ideas.nobody answered about 2 days on google+ no one cares about posts on google+.public support of google wear for developers is sucks at the moment.
I need more customizable things for android wear to build apps.
but in current stage,i can't do much things with it.
i wish we had these features in screenshots below..
Those things are still not possible with the current preview release of AndroidWear.
If you look closely, you'll see that they've been using photoshop (or some other photo editing software)
Using these templates to design an app for Android Wear.
And for testing the design on the watch they used Android Design Preview which is a tool that lets you mirror a portion of your desktop to your device:

Resources