Android printing in kiosk mode - android

I'm trying to build an Android application that will run in Kiosk mode. Guests will scan their tickets, and a name tag should automatically print for them with a welcome message on it.
I'm trying to do this using Google Cloud Printing. Right now I'm simply using the sample code from the official tutorial, and it works so far (as in, I can print documents and everything), but I have to run through two dialog pages:
1 to select the printer in question, and
2 to select the printing preferences.
Is there any way to skip these two dialogs? I would like the user to have as little interaction with the app as possible.

Related

how to configure one or more invocation names for my android app actions application

Im investigating adding App Actions to my existing Android application
I have a number of actions working ok using the Google Assistant App Actions test tool and some voice commands work ok when i try using the actual device app actions feature
my problem is my application name seems to confuse android actions assistant
is there any way i can configure an alternative invocation name for my android application?
a name that is easy to pronounce and the assistant to understand?

What's the appropriate way to test if app icon badge numbers show in Android?

There are lots Huawei icon badges related threads in SO, like How to show App Icon Badge Numbers on Huawei, and I have read the official document of Badges.
I do think the official documents are good enough, I just want to know how may we test it automatically?
For example, if one of the engineers in the team who mis-config the config the Badge-related SDK files, customers' Huawei phone would still able to push the notification, but the Badge number might not show.
I believe the image classification tech would help, like, we could test it automatically in the following way:
Install the app and login the app by adb shell command + uiautomator
Back the home screen in order to view the icon
Push notifications from backend server.
Screenshot the phone, and use some deep learning tech image classification to verify if there's Badge numbers on it.
It may not the best way to test it in these steps, I was wondering if maybe there is any native API to fetch the badge numbers?
The best way to find this kind of information is to look for open source apps, like settings or launcher apps:
https://github.com/aosp-mirror/platform_packages_apps_settings/blob/master/src/com/android/settings/notification/BadgingNotificationPreferenceController.java
https://github.com/OpenLauncherTeam/openlauncher/blob/master/app/src/main/java/com/benny/openlauncher/notifications/NotificationListener.java
If you want to verify whether notification badges or on or off you can do:
Settings.Secure.getInt(context.contentResolver, "notification_badging")
This is even documented in the Settings class, but the setting name (Settings.Secure.NOTIFICATION_BADGING) is part of the hidden (internal) API. But still it works, at least it does for stock Android. For Huawei devices you'll have to test by yourself.
For obtaining the badge count, I don't know if it can be directly obtained. From the second link above, it seems you have to make a notification listener to count incoming notifications.

Google Assistant Actions

I am trying to use the Google Assistant to launch an activity of my Android app with a specific parameter.
I have read this:
https://codelabs.developers.google.com/codelabs/actions-1/#0
https://developers.google.com/assistant/app/action-schema
https://developers.google.com/assistant/app/get-started
But I am confused, completely lost.
From my point of view, everything looks messy and confused.
In the Actions Console I have created one Action Project called "Actions Project for my app".
Then I went to the DialogFlow console and modified the Default Welcome Intent and created some other intent. Both were tested using the testing option "See how it works in Google Assistant."
It worked well doing those testings.
Then, in another site I read that I have to create an Action.xml file in my app project in Android studio. But how do I have to do that? Do I have to "export" my project "Actions Project for my app" to some xml file? I think that documentation is not enough for clumsy people like me. I don't really know the next step. I am really struggling with this.
Basically I want the assistant to let the user say something, then pass that information to my app, do somework and then execute an activity to do something.
For example, if we are talking about MyCookingApp I want this:
User: Ok Google, talk to MyCookingApp
Assistant: Welcome to MyCookingApp, what do you want to cook?
User: Pizza
Assistant should open my app with the parameter "Pizza". My app should display an activity with a pizza image and the recepie for it.
Is all this possible?
Connecting your serverside Action to your Android app is not directly feasible. Actions on Google is available on a variety of surfaces beyond Android, so you can't necessarily expect the Action to immediately launch your app. However, there are a few ways to get the behavior that you want:
Make your response include a BasicCard which has a link to deep link into your app
Look at using App Actions to achieve the behavior you want, which is designed for the Assistant to link into Android apps
From your Action's webhook, send a push notification to the user's phone (assuming you have account linking setup) to your app to open it up

How to enable logging option in android and ios devices using xamarin.forms app

In my cross-platform Xamarin Forms application I would like to have a Logging option. If it's enabled, it should generate a log file stating the errors or in which step the app is crashing (if any of these takes places while the app is running) and I should be able to pull and check this generated log file.
When I googled for this I found on many sites that we need to debug using usb and check it on android adb, but once the application goes live and user downloads it in their phone if app crashes any time then the user should be able to turn on the logging button and once the process is run it generates a log file. The user can then send the file to the developer to check what exactly is happening in the system.
How do I implement this feature in Xamarin Forms for both iPhone and Android?
What about analytics service like hokeyapp or appcenter.ms
They do what you and more.
But if you want to implements this by yourself is still possible but you need to write specific code on both plateform to handle exception and write them on files with stack traces

Use Google Assistant to directly talk to my Android app and execute a very simple task

I am working on a project to integrate the Google Assistant with an existing Android app. The requirements are simple. Assuming my app is named TestApp and I want it to just change the background color of the app home page, I want to be able to say,
"Hey Google, Change background to black on TestApp".
I was given links to ActionsSDK, but looking into it, I see that it is only a stand-alone app that extends Google Assistant and has nothing to do with android itself.
The closest API I found that does what I need is the Voice Interactions. This is very similar to what I need done but it only allows preset voice triggers such as "call this person..." or "set alarm at...", but cannot do "change background..." like in in my example. According to this link, custom voice actions aren't allowed.
So my question is, is it possible to directly interact with my app and have it do a very simple task?
Thanks
You may want to connect an Android app property with your Actions project to sell your digital goods in the Play store. Implement digital transactions to sell your Play store items as part of a conversation with your Action.
To connect an Android app with your Actions console project, you will first need to connect a website to your project. Follow the instructions provided above in Connecting a website.
Once you've connected a website, under Android app, click the Connect App button and follow the instructions shown. Once you have completed the instructions over in the Play console, it may take up to 24hrs before the connected Android app is reflected in the Actions console.
Try this in Action on google
Right now there is no way to do communication between Android App and Google Assistant. If your GA is built upon Dialogflow API (specifically not using action-on-google), then you can use Dialogflow Android client in your Android App to communicate with Dialogflow Agent.
I wrote an app for my own use to brighten the screen when I was in bright sunshine and could not see the screen by asking the assistant to launch the app. Then on launch I executed code to make the change. A cheesy work-around I know :-)
you can try using this
[1]: https://docs.slanglabs.in/slang/
This will allow you to perform several actions through voice inside your app. You can use the console to add actions and utterances and there are some sample apps which might help you.
I have used it in a lot of my apps.
Feel free to reach out in case you need help, good luck!

Categories

Resources