Android :: TextToSpeech SetOnUtteranceCompletedListener Always Returns -1 Error
Apr 21, 2010
I've been working with Android's TTS functions with general success however, one piece of it refuses to work for me; I can not successfully assign an OnUtteranceCompletedListener to my TextToSpeech object.
I've tried implementing OnUtteranceCompletedListener in one of my classes and I've tried creating a new, stand-alone OnUtteranceCompletedListener instance. Both approaches are simple enough to implement and appear to yield proper listeners without exceptions...yet setOnUtteranceCompletedListener(myListener) ALWAYS returns -1 (ERROR).
The documentation for this seems straight forward. Has anyone gotten this to work? I'm targeting SDK 4. Are there known issues with this with SDK4/v1.6?
View 1 Replies
Aug 31, 2010
ContentResolver cr = getContentResolver(); Uri pic = Uri.parse("content://media/external/images/media/3");
Bitmap bm = Media.getBitmap(cr,pic); The above code is written in onCreate method of my Activity class. It throws the following error:
08-30 12:27:22.352: WARN/System.err(245): java.io.FileNotFoundException: No content provider: [content://media/external/images/media/3]
What could be wrong? The file in question is there because I launched Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI) in another method and got back the Uri of the picked image from the returned intent.
View 1 Replies
View Related
Feb 22, 2010
I'm following the official docs at http://developer.android.com/resources/articles/tts.html and trying to synthesize a String to a file:
CODE:............
Then I run adb shell on the emulator to check if there is anything saved to the file system. And there is nothing. I tried to save to non existent folders, but synthesizeToFile still reports SUCCESS and nothing new appears in the file system.
Am I missing something or synthesizeToFile is just not working?
View 4 Replies
View Related
May 7, 2010
I am trying to implement text to speech by following this article on the Android Developers Blog. It suggests the following code for installing text to speech data if it is not supported.
CODE:...........
This throws an Exception:
ActivityNotFoundException: No activity found to handle Intent
However, I am using the code here to determine the the intent is actually supported. Here is the list representation:
[ResolveInfo{43cc5280 com.svox.pico.DownloadVoiceData p=0 o=0 m=0x108000}]
Why doesn't this work?
Update
I don't know why, but it seems to work now.
View 2 Replies
View Related
Aug 16, 2010
I wrote successfully TTS with some references in Activity.
However, I want to call this TTS in my own class as below.
CODE:............
View 3 Replies
View Related
Apr 13, 2010
I added TextToSpeech to my app, following the guidelines in the following post:
http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html
and now my onDestroy is no longer called when the back button is pressed.
I filed a bug report regarding this: http://code.google.com/p/android/issues/detail?id=7674
Figured i should also ask here if someone else has seen this, and found a solution?
It seems that it is the intent that causes the problem, i.e. the following:
CODE:................
If I skip this intent, and just go ahead and create a tts-instance, it works fine.
Any clues to what is wrong with this intent?
View 2 Replies
View Related
Feb 28, 2010
I'm looking for a way of making TextToSpeech.synthesizeToFile save output to internal memoryl instead of /sdcard. I've read the docs: http://developer.android.com/intl/fr/resources/articles/tts.html, then had a quick look at the SDK source code. Found out that SDK TTS functions are using the PICO Text to Speech from libttsespeak.so, didn't go any further yet.
Anyone ever synthesized a text to a File and did it to internal memory, (like a FileOutputStream), not to /sdcard?
I want to be able to publish the saved wav through a Content Provider. And being dependent on the presence of /sdcard does not seem the ''proper'' way to me.
View 3 Replies
View Related
Jul 31, 2010
I have built in the Sample code from LVL and putted it into my main activity.I haven't understood why it always returns LICENSED also if I setted UNlicensed from my developer console.I have no idea on why it gives me always licensed.
View 14 Replies
View Related
Aug 26, 2009
I am having a real hard time with the geocoder API of android sdk 1.5rc2. In my app I am trying to get the addresses corresponding to a location name by using the getFromLocationName method of the Geocoder class. But the problem is whenever I call this method it returns a null value. I have also pushed a geodb file containing some fake addresses at 'data/misc/location' directory in the phone.
The format of the data in the geodb file is as follows :
address 1 latitude "38.898763" longitude "-77.036655" line 0 "1600 Pennsylvania Ave NW" line 1 "Washington, DC 20006" locality "Washington" region "DC" postalCode "20006" countryCode "US" countryName "United States"
and following is the code snippet : Geocoder geocoder = new Geocoder(this, Locale.getDefault()); List<Address> addresses=geocoder.getFromLocationName("1600 Pennsylvania", 10);
View 2 Replies
View Related
Sep 7, 2010
I have a list that gets refreshed every 2 seconds via the Handler postDelayed() method.Every 2 seconds an AsyncTask is run that makes an HTTP GET request, turns the JSON into a list of objects, then sets the ListAdapter.My problem is that every time the task completes (so, roughly every two seconds) my list jumps back to the top, even if I have scrolled down to the middle or bottom of the list. This would be very annoying to the end user, so I need the list to update in the background, as it's doing, but the current view of the list to not jump back to the top at the completion of the AsyncTask.I can include any more code needed. I'm somewhat new to android development, so I'm not sure what is helpful to others.
View 1 Replies
View Related
Jul 20, 2010
I need to check web site availability and use requestRouteToHost for that purpose. On real device everything works fine, but on emulator requestRouteToHost always return "false".
What's wrong? Code is:............
View 3 Replies
View Related
Jul 12, 2010
I have super.xml and a subset.xml.
...............
I get a null pointer exception at price.setText(data.getStrTotalPrice()); Very strange, name.setText(data.getStrDescription()); does not give a null pointer exception.
View 3 Replies
View Related
Nov 15, 2009
Following other threads - I'm trying to get a unique device ID from the device. I tried this:
String ID = Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
but this returns null when running on my G1. Is it supposed to be returning a valid number, or am I accessing it wrong? I don't want to use the telephony device ID because that requires more permissions.
View 13 Replies
View Related
Jul 14, 2009
I am running this piece of code..............
View 10 Replies
View Related
Feb 26, 2009
I am trying to solve my problem about InputStreamReader returns null..I have a Login screen which checks the configuration file. and here is the configuration class import java.io.*;
import j2me.microtools.BufferedReader; import j2me.microtools.BufferedWriter; import j2me.microtools.FileReader; import j2me.microtools.FileWriter;.....................
View 2 Replies
View Related
Feb 1, 2009
why RingtoneManager.getRingtone(this, Settings.System.DEFAULT_RINGTONE_URI); always returns null when launching from my activity? Shouldn't it return some object which is System.DEFAULT_RINGTONE_URI, which I can then play()? Is there any small example of code which shows how to play Ringtone from Activity? MediaPlayer way also not works. MediaPlayer.create(this, Settings.System.DEFAULT_RINGTONE_URI)
simply crashes with:
02-01 11:19:51.008: ERROR/TAG(351): null 02-01 11:19:51.008: ERROR/TAG(351): java.lang.NullPointerException 02-01 11:19:51.008: ERROR/TAG(351): at android.content.ContextWrapper.getContentResolver(ContextWrapper.java: 89) 02-01 11:19:51.008: ERROR/TAG(351): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:589) 02-01 11:19:51.008: ERROR/TAG(351): at android.media.MediaPlayer.create(MediaPlayer.java:516) 02-01 11:19:51.008: ERROR/TAG(351): at android.media.MediaPlayer.create(MediaPlayer.java:497)
View 2 Replies
View Related
Feb 5, 2010
The GPS on my Android phone is on, supported by the fact that :
location_manager.isProviderEnabled(LocationManager.GPS_PROVIDER)
returns true. Yet, the following line: Location location = location_manager.getLastKnownLocation(LocationManager.GPS_PROVIDER); returns null.
View 1 Replies
View Related
Mar 19, 2010
I'm currently working on Mangler's Android implementation. I have a java class that looks like so:
public class VentriloEventData {
public short type;
public class _pcm {
public int length;
public short send_type;
public int rate;
public byte channels;
};
_pcm pcm;
}
The signature for my pcm object:......................
View 1 Replies
View Related
Sep 4, 2010
HashMap myMap = (HashMap) getLastNonConfigurationInstance();
myMap is always null. getLastNonConfigurationInstance() should return an object.
public Object onRetainNonConfigurationInstance()
{
HashMap myMap = new HashMap();
myMap.put("symbol", this.symbol);
final Object data = myMap;
return data;
}
View 1 Replies
View Related
May 21, 2009
I'm having no luck getting getLastKnownLocation to return a non-null value in the Android emulator running in Eclipse. The following call always returns null:
locationManager.getLastKnownLocation(bestProvider);
(bestprovider is "gps")
In the intent's onCreate method I spawn a thread that calls requestFirstUpdate(). The onLocationChanged method fires so I presume the location was updated (I use the location section of the DDMS to push out a location first)..................
View 3 Replies
View Related
Oct 13, 2010
I have an AutoCompleteTextView with a MatrixCursor as an adapter. The AutoCompleteTextView has a OnItemClickListener as follows:
CODE:...............
When an item is selected I see following in the log
CODE:................
If you see the log, the Before log entry, the getText() returns a SpannableStringBuilder object and toString() of it returns some object identifier.
How do I get actual text of the auto-complete view which was there just before clicking drop-down item?
View 2 Replies
View Related
Oct 3, 2009
I have an activity which performs an image search, the results (URLs of thumbnails on the web) are rendered in a GridView. My GridView adapter class delegates creating the actual Bitmaps to an AsyncTask that loops to sequentially fetch the image content from each URL using HTTPClient, and creates the Bitmaps using:
BitmapFactory.decodeStream(entity.getContent()).
I found that the above method sometimes returns "null" silently instead of creating a Bitmap. The occurrences appear to correlate with larger stream sizes (I check this by logging entity.getContentLength()). However, if I put a breakpoint just prior to the decodeStream call & then resume immediately every time I hit it (i.e. pause briefly on each iteration), the Bitmaps are created perfectly every time. All the images are quite small (most <10K), so the download & decodeStream happens fairly quickly. There are never more than 10 images processed in one AsyncTask.
View 6 Replies
View Related
Aug 18, 2010
In my application I am converting base64 string to image.For that I initially converted base 64 file to byte array and later am trying to convert to images.
To convert to Images I am using the below code
File sdImageMainDirectory = new File("/data/data/com.ayansys.Base64trial");
FileOutputStream fileOutputStream = null;
String nameFile="Images";
try {.......................
View 1 Replies
View Related
May 15, 2010
I'm experiencing the same as http://groups.google.com/group/android-developers/msg/9d37d64aad0ee357
This is Android 1.5 SDK. I happen to call several times below code(which is in a method) with the same url and it fails intermitently. When it fails, there is no exception, the stream is empty so the readConnection fails, and getResponseCode returns -1. Global caching is disabled, setDefaultUseCaches(false);
How can I workaround this?
CODE:.........................
View 4 Replies
View Related
Mar 15, 2010
I've been trying to use the CacheManager for caching some http requests but it failed every time with a nullpointer exception. After some digging I believe I found out why: CacheManager.getCacheFileBaseDir() always returns null so when I try to use CacheManager.getCacheFile() or CacheManager.saveCacheFile() they fail.
CacheManager.cacheDisabled() returns false :S I hadn 't created a cache partition via the AVD manager so I thought the problem lie there. But after creating a cache partition getCacheFile() still return null:
03-16 00:25:16.321: ERROR/AndroidRuntime(296): Caused by: java.lang.NullPointerException 03-16 00:25:16.321: ERROR/AndroidRuntime(296): at android.webkit.CacheManager.getCacheFile(CacheManager.java:296)
What could be the problem? I've got the code posted here: http://pastebin.com/eaJwfXEK But it's a bit messy because I've been trying tons of stuff.
View 4 Replies
View Related
Mar 16, 2010
I've been trying to use the CacheManager for caching some http requests but it failed every time with a nullpointer exception. After some digging I believe I found out why: CacheManager.getCacheFileBaseDir() always returns null so when I try to use CacheManager.getCacheFile() or CacheManager.saveCacheFile()
they fail. CacheManager.cacheDisabled() returns false. I hadn 't created a cache partition via the AVD manager so I thought the problem lie there. But after creating a cache partition getCacheFile() still return null:
03-16 00:25:16.321: ERROR/AndroidRuntime(296): Caused by: java.lang.NullPointerException
03-16 00:25:16.321: ERROR/AndroidRuntime(296): at android.webkit.CacheManager.getCacheFile(CacheManager.java:296)
View 2 Replies
View Related
Jun 13, 2010
I'm trying to save a file in Activity.onPause method and sometimes (I've fond it in Market stacktrace) View.getContext returns NULL. The code:
public class MyActivity extends Activity { ... @Override protected void onPause() { super.onPause(); surface.saveState(); } ...
}
View 2 Replies
View Related
May 2, 2010
I am having trouble debugging my app where i have an sub activity which uses the static method getRingtone. Sometimes it works, sometimes it returns null. Specifically its in a custom listview in the getView function. Strangely enough, i have another sub activity which this always works. I suppose the only difference would be the context passed in. I am looking for tips on how to determine why RingtoneManager.getRingtone is returning null, and what those conditions might be.
simply put, here is the sample code line: Ringtone rt = RingtoneManager.getRingtone(context, Uri.parse(strTemp)); strTemp is a string that looks like content://media/external/audio/media/9 I verified that Uri.parse returns a Uri object, context is what is passed into the ListActivity constructor. Any advice is appreciated.
View 2 Replies
View Related
Oct 17, 2009
I can't display my map on android emulator. i have, locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); location = locationManager.getLastKnownLocation("gps"); After those lines,the Log shows null for location instead of the object location
View 4 Replies
View Related
Sep 14, 2010
This was working at one time in development but now it does not seem to be working. I am using the emulator right now and it DID return 5555218135 before (a few days ago) but now it is returning null. I have <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission> listed in the AndroidManifest.xml. I do not know of anything I changed that should affect this.
View 3 Replies
View Related