Voice command in Android activity - java

I have an activity in my app that has a counter for 2 different teams, now, to add a point to this teams I need to click a button.
I want to do this also with a voice command.
The thing is that I need: offline voice recognition, add points but not restart the activity, wait continuously for another voice command, only work in one Activity.
And the language will be Spanish.
Do you know any way to do this?
I have been searching and find PocketSphinx, but I don't know if this is the best option.

Finally I did it, and YES, is posible with PocketSphinx.
I had to edit the code but this page was very helpul.

Related

How to block user from changing to other apps

I want to make an activity in my native android app that doesn't allow to change to other apps, or open settings or go back to home screen, just like the alarm apps do when the alarm comes in, but I can't find anything about how to do this.
Does anybody know how to do this?

How to add shortcut on home screen when app gets install

I know it's not the best practice, but it is a requested feature (e.g. for business apps). When the App gets installed, I need to automatically place it on the home screen. I saw a lot of code on the internet, but all of the code only works on button click when the app starts. But I need to place a shortcut on the homescreen immediately after the app is installed and before the app starts. Is there a way I can achieve this?
PS: To make the question more clear: The app will be distributed without Google Play Store, so that's not an option.
Thanks for your help!
Best regards,
Robin
You can't run any code in your application before the user starts your application for first time during to restrictions since Android 3.1. Check this for more information
That's an optional feature of the Market app, not of the apps themselves. When designing an application , it does not receive a broadcast about itself being installed.
the first time the app launched can create it.
You can achieve that by creating a method in your main activity and call this method from oncreate and create a boolean variable andsave it in shared preferences

Android Record Video With Code In Background

I was wondering what the best way to do this is. What I'm hoping to do is have a user push a button and automatically take a 10 second video, then save it to the SD card. I've seen how to do it through creating a new Intent, but the user then has to do the extra step of pushing record after selecting that they want to go to video. My goal is for them to push one button--one in my app that says "record", have it start recording for 10 seconds, then stop and save. In addition, I'd like to have some code executing in the background without being interrupted during said recording. What is the best way to do this?
Opening the camera with an Intent is simply opening the system camera app to take a picture/video. For more advanced usage, you can control the camera directly. Full details are in Controlling the Camera (from Android Developers).
You should make a service for that.

How to open my Android app on a long press of home, back or recent apps button?

I want my users to be able to launch my app by long pressing back button, recent apps button or home button. Or even long press on volume up/down or power button.... something which would allow users to execute my app without touching a screen icon.
I offer similar voice solution to Google Now, which btw. opens after a long press on home button. Any way I can do the same? I get this question from my users almost daily...
I don't think your users will be able to do this without rooting. I found this thread which is worth reading:
http://forums.androidcentral.com/samsung-galaxy-s3/183113-button-remapping.html
alternatively they mentioned Go Launcher app
I've read through the list of ACTIONs that you can use for starting an activity through intents, but can not find any of the ones you wanted. If you do find any other ACTION useful there is more info on how to actually do it here.

Android pattern for activity "flows"

I'm developing an android app that has a bunch of screens (activities) that are supposed to have "continue" and "back" buttons at the top. Can you tell me the right pattern for implementing this? I've seen some iPhone apps that have this but Android apps usually don't (I think partly because the back button is part of the phone).
I found a post online about an Activity class that has "sub activities" which kind of seems like what I want to do, but I'm wondering if there's a simpler solution or pattern for creating flows like this (in which several activities are linked with continue/back buttons).
You answered part of it yourself. There shouldn't generally be a software back button because android has a hardware back button. As for a continue button, that's extremely context dependant so it would probably be written in software based on the context.
No that doesn't sound like what you want. You're probably thinking of an activity group and from the very vague description of your design, you don't want those. There's no "simpler" solution or pattern to create flows like this because this is the exact default android behaviour.
Just start a new activity in your "continue" button, and the back button will finish that activity.
I'm developing an android app that has a bunch of screens (activities) that are supposed to have "continue" and "back" buttons at the top.
If you want to implement a wizard, use buttons at the bottom and do it as a single activity, perhaps using a ViewFlipper for the changing contents.
If this is not logically a wizard, just allow the BACK button to handle "back", and tapping on something meaningful to go forward, as a set of regular activities, like a regular Android application would.
In other words, please follow platform navigation conventions.
can you just open a new activity as per usual android development and make the back button call finish() you can set your theme to make the activity animate out like the iphone when finish is called.

Categories

Resources