speakToUser not defined in eclipse - android

can anyone please tell me why speakToUser is undefined in eclipse. I could not get much help online.
I have written a class abcAccService extending AccessibilityService, taking code from developer site, I wanted to use speakToUser function. But I get undefined function in eclipse. What could be the reason for this.
Thanks

I believe this is the code you are refering to:
// Do something nifty with this text, like speak the composed string
// back to the user.
speakToUser(eventText);
...
That isn't a real method. They don't explain it clearly but this is just a theoretical method that you need to write yourself.
To create a speakToUser() method you'll need to use the TextToSpeech class, you can follow a tutorial to help you. There is even a sample project included with the SDK, in Eclipse go to:
New -> Other...
Then Android > Android Sample Project
Eventually select TtsEngine.

Related

Any way to see all the methods that don't work at once? Android Studio

I have to estimate the time it takes to update a specific application made for Android 4.4 to Android 10 and I need to see all the methods that are deprecated or not working. Is there any way to see the methods without going file by file? (I'm using Android Studio with Java)
When I build the application I only get one or two types of error at a time, when I correct them I get another one and so on.
Thanks and best regards.
P.S: How long does it take you to update something like that? I'm a junior and I'm a little lost doing this.
Here, go to Analyze -> Inspect code. After inspecting check maturity there you will have depreciated methods. (Don't forget to change minSdk)
After you will do that it give you method with a warning and you can filter it by having API not support warning

android studio - default constructor?

I need your help. I created an app in Android Studio, then I created a second "page", well I created a second class.
But it says this class needs an default constructor. What shall I do?
I hope you can help.
Cheers
Follow a tutorial if you are new to Android Development.
https://androidcookbook.com/Recipe.seam?recipeId=1670
Could help you understand the flow better. Google is your friend, don't be afraid to search if you need tutorials.

Code android for a KitchenTimer

is there someone who can help me to find a android code to create a kitchen >timer (I am a beginner)
As said in the comments, not sure why you didn't just search Google. However I'd advise using the inbuilt CountDownTimer class. Here is an example of how to set it all up:
http://www.theappguruz.com/blog/android-count-timer

Eclipse doesn't offer to add import or show functions for android objects

Somehow I've screwed up my Eclipse installation. Used to be if I added a new instance of an Android object (say a TextView) and I right clicked on the error, it would offer to add the import. Also if I had an Android object and typed it followed by a period, it would show me all the allowed functions. Now it doesn't do either, just shows me java info. Don't know what I did, since this used to work. I updated everything, but still no joy. Can anyone help me get this back to the way it was?
Thanks,
Dan
Check your settings in Window->Preferences->Java->Editor->Content Assist

How do I see the core Android classes?

I am trying to look inside a couple of Android core classes to see about overriding some methods. I have looked into getting the Android source code, but the process described on the Android dev site is all about installing and setting up some kind of development environment. This is not necessary to me. I just want to open a class or two in a text editor and look at its contents. Does anyone know if this is possible without going through the multitude of steps described on the Android dev forums?
The easiest way is to use Google Code Search. You just have to try a search like Activity.java android and you can see the source code of that class. It even has an outline inspector:
You can download the entire source with git our just look it up as a reference on the git site. Here is a link to the sdk code:
https://android.googlesource.com/platform/frameworks/base
Another option is to use http://grepcode.com/ and perform a search such as "android ViewGroup". I've really enjoyed the style of using grepcode.

Categories

Resources