Streaming internet radio error android - android

I am trying out to play internet radio with an example downloaded from
http://www.4shared.com/zip/OTcJZZft/StreamingRadio.html
which works kinda like given in this example Online radio streaming app for Android, but the problem is my logcat keeps throwing this error:
11-07 17:20:39.207: E/MediaPlayer(335): error (1, -1002)
11-07 17:20:39.237: E/MediaPlayer(335): Error (1,-1002)
11-07 17:20:48.882: W/KeyCharacterMap(335): No keyboard for id 0
11-07 17:20:48.886: W/KeyCharacterMap(335): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
I am unable to understand what this means. Can someone please explain what it means and also if someone can guide me to a fresh tutorial for internet radio streaming it would be great help.
Thanks.

MediaPlayer is throwing that error (1, -1002) in response to the URL you passed it in the setDataSource(String) method. Set up an onErrorListener() for your MediaPlayer object and catch the error thrown by the player. (Quick look at the documentation - http://developer.android.com/reference/android/media/MediaPlayer.OnErrorListener.html) You can evaluate the error by checking the code thrown via the logcat or a Toast object and take appropriate action based on that.
In my experience with playing internet radio I've found that most often, that or similiar errors thrown by the MediaPlayer are caused by the stream being invalid from the server or the station is no longer viable through that URL. Try to gather several other links and try them to see which ones work and which do not.

Related

What is the meaning of the CastStatusCodes 2255?

I have an Android sender app and Android TV receiver app. When I start to connect the Android TV receiver app, it returns an error code 2255 in onSessionStartFailed().
I have referred the Google Cast documentation (https://developers.google.com/android/reference/com/google/android/gms/cast/CastStatusCodes) and cannot found the definition of 2255 in this page.
Also, I try to read the code from com.google.android.gms.cast.CastStatusCodes, it seems that error code 2255 is a special case.
if (var0 < 2300) {
return String.format(Locale.ROOT, "Cast remote display status code %d", var0);
}
Thanks in advance.
Not sure if this is your issue, but this can happen if you try to run the Cast Debug Logger on a non-google receiver hardware.
As it says:
Warning: Make sure to change setEnabled to false for a production receiver.
Properly disabling it in prod fixed the issue for me. But, man, it's so bad that error codes are not properly documented. There are several other that can also be thrown for various reasons that are undocumented.
What was actually happening for me is the CAF library was throwing an exception because it is trying to load the debug logger, but the debug logger is not supported on non-google hardware. This caused the VM to not launch properly and so it started throwing remote display errors.
If that is not your issue, you should try to log in to the back-end if your device if possible and download an error log. Sometimes that can highlight what is happening. I don't know if it's possible to crash the VM in other ways, but it might be and the error log might show why.

AUDIO_OUTPUT_FLAG_FAST denied by client

I'm getting this AudioTrack warning
AUDIO_OUTPUT_FLAG_FAST denied by client
in my Android app for a button I'm subclassing. I can hear a click when tapping on the button so is this anything to worry about?
Note: I'm not getting the mismatching sample rate message as in this question: AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client due to mismatching sample rate
Most likely, the tap sound got a AUDIO_OUTPUT_FLAG_FAST in order to use low-latency playback if possible, but the AudioTrack class considered the track settings to be incompatible with the low-latency audio output, so the flag got removed and the track got treated as if the flag hadn't been set to begin with. So I wouldn't consider this to be something to worry about.
As for the reason why the flag got denied; I'd still say that the most probable reason is a sample rate mismatch. The log in the question you linked to appears to have been added in this commit to the AOSP. But if we look at the master branch of the code base used on many Qualcomm-based devices we see that it still has the "AUDIO_OUTPUT_FLAG_FAST denied by client" log in the case were there was a sample rate mismatch. Which logs you get depends on the exact implemetation running on your device (i.e. which device and Android version you're running).
Try changing the sample rate at
"frameworks/base/
frameworks/av/
hardware/libhardware" locations.
default sample rate is 44100 try setting the sample rate you want (your audio files have).
it will work.
cheers.
I had the same problem, my problem was caused because I forgotten type activity define in manifest file. such as : activity android:name=".NFCReaderActivity"

android developer crash report

I have an application on google play.
I made a new version with a higher versioncode and different name.
Tested it on my own android device (v2.3.3) and an emulator (v4.0.3).
No errors so far, so i put the update on the market.
Now the first error reports come in!!!!! (see below)
I dont know what it means.
The new update was a little change in the permissions and i removed two libraries (jumptap SDK and jumptap adapter for admob mediation).
The removed permissions were:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Leaving these two for admob ads:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
The error code:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.masked.app/com.masked.app.mainjava}:java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2705)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)
at android.app.ActivityThread.access$2300(ActivityThread.java:132)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4669)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.masked.app.mainjava.onCreate(mainjava.java:53)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
At line 132 there is "adblockcheck();" that can be found here
How to prevent ad blocker from blocking ads on an app ;
line 123 is also within this code.
At line 53 a mediaplayer is started (mp.start();) with a starting sound.
What is the problem exactly, and why don't i get the error on my devices?
This is my first error report through google play, is one error problematic or are there more developers that experience errors and don't always care about them?
Full Mainjava.java can be downloaded here http://homepage.tudelft.nl/78u5u/main.zip
EDIT:
R.raw.start is a mp3 file.
Obviously, your MediaPlayer mp instance is null. It means that MediaPlayer.create method returned null.
As said in android documenation for create method:
Returns
a MediaPlayer object, or null if creation failed
I think, android can't create MediaPlayer for you beacuse of lack required codecs or so on. What is format of your R.raw.start file? You can try to play with formats.
Whatever, you need to gracefuly handle this exception.
Also, as just said before, I advice you to use ACRA. It can help you resolve problems quickly. By my expirence, Android users don't like to send error reports. Less than 10% of errors are reported to the google play.
UPDATE:
ACRA is good enough, but not perfect, because of blocking. It means that if app is just crashed and user have slow internet connection, you can get the ANR message. Let imagine: User thinks that app is just hang, and decided to wait for app response and then gets "Sorry, app crashed" message. You must find the way to send reports via background service or so on before using ACRA.
Also, Google Docs - default backend for sending errors - is awful. It is highly recommended to use another backend. If your app is small enough and you think you will receive less 500 error reports in a month you can try proprietary BugSense, it is supports ACRA.
It's going to be hard to tell what is really going on without seeing (at least) your whole onCreate() method in com.masked.app.mainjava. It sounds like you didn't initialize your media player.
If anyone else is having trouble with crash reports, this is an AMAZING way to get better feedback on Android is this project: http://code.google.com/p/acra/
EDIT:
Your problem is almost certainly caused by the a codec issue (your device cannot play the given resource due to its filetype/format). What type of sound file is it?
You can get around your issue by changing this block:
if (startsoundint == 1){
MediaPlayer mp = MediaPlayer.create(Mainjava.this, R.raw.start);
if (mp != null) // null check
{
mp.start();
}
}
And yes, this means it's probably not a new bug, unless you changed the sound file.

Using audioSessionId value to instantiate AudioFx class?

I have read the Android APIs and tried searching over the internet about declaring a custom audioSessionId and then using that audioSessionId to initialize an AudioFx class and assign my MediaPlayer or AudioTrack the hardcoded audioSessionId.
This method would allow me to create an AudioFx first and later attach a new MediaPlayer or AudioTrack to this audioSessionId.
I'm currently able to use this method on Android 2.3.6 but on Android 4.x I'm running into issues with errors that initialization fails or on other ICS/JellyBean devices this error is silent but calling a function leads to exceptions.
Samsung Galaxy S II [Android 4.0.3]: [Issue no longer happens with Android 4.0.4]
E/AudioEffect(13250): set(): AudioFlinger could not create effect, status: -38
E/AudioEffects-JNI(13250): AudioEffect initCheck failed -5
E/AudioEffect-JAVA(13250): Error code -5 when initializing AudioEffect.
W/WrapEqualizer(13250): createEqualizer() -> Effect library not loaded
Motorola Xoom [Android 4.1.2]
Fails it seems silently after the constructor. Then calling on getProperties() it crashes.
java.lang.RuntimeException: AudioEffect: set/get parameter error
at android.media.audiofx.AudioEffect.checkStatus(AudioEffect.java:1247)
at android.media.audiofx.Equalizer.getProperties(Equalizer.java:532)
Nexus 4 [Android 4.2.1]
Using audioSessionId=0 everything works fine but using any other number the device will report the following silent error every time I try to change the preset, band level, bass boost to ON or Virtualizer to ON. The effect ID reported is different depending on the FX I'm trying to modify.
W/AudioPolicyManagerBase(165): unregisterEffect() unknown effect ID 1381
Update 08/11/12:
I'm able to use audioSessionId as 0. I know it's deprecated but it works using the permission. <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> Should I be using the AudioFx with the audio session id 0?
You should look at: this
Apparently it is an unsolved issue came up in ICS, and probably wasn't solved either in JB.
Should I be using the AudioFx with the audio session id 0?
It will probably work in some cases, but don't count on it to continue to do so on future Android versions. You'll already be compromising interoperability between your app and other apps on Jellybean. Just take a look at what the AudioFlinger does when an effect is enabled:
// suspend all effects in AUDIO_SESSION_OUTPUT_MIX when enabling any effect on
// another session. This gives the priority to well behaved effect control panels
// and applications not using global effects.
// Enabling post processing in AUDIO_SESSION_OUTPUT_STAGE session does not affect
// global effects
if ((sessionId != AUDIO_SESSION_OUTPUT_MIX) && (sessionId != AUDIO_SESSION_OUTPUT_STAGE)) {
setEffectSuspended_l(NULL, enabled, AUDIO_SESSION_OUTPUT_MIX);
}
i know this issue
if somebody want to try
do this
Equalizer eq=null;
.
.
.
.
.
//in any function before initialization do this
if(eq!=null)
eq.release();
eq=new Equalizer(0, audiosessionid);
try it once
Other than session 0 which is the "deprecated global session", my understanding of the AudioFlinger code shows that sessions are only created for classes which actually do audio IO, that is, AudioRecord, AudioTrack, MediaPlayer etc. You should create these classes, and then get their session ID, and then attach the effect.
Any other value you supply for session ID will correspond to an audio session that does not exist, and so will fail.

Uncaught Error #2063 exception in Android flex application

My clients using my application on ANDROID and a lot of them are reporting uncaught exception error while using my Flex 4.6 application with latest Flash Player 11.1 swc.
My Flex application uses standard SPARK and MX components. The uncaught exception occurs immediately after application is launched, however none of my functions (connecting to RTMP, RTMFP & socket servers) seem to cause it, the error occurs after all the functions that I call upon program start have successfully executed.
Looks like error code #2063 means "Error attempting to execute IME command.".
My code doesn't call or access any IME functions at all.
It seems that this developer is experiencing same issue and is unable to locate the solution or workaround:
Flex/Flash runtime error #2063 on android
Also, none of the clients using Windows/Mac/Linux are experiencing this issue, only Android clients.
And they all are accessing same application/same code/exact same file.
It also seems like clients are not doing anything specific that triggers this error - they just start my flash site on their android browser and do not do any interaction with it, and getting this error just after launch.
What do I do / what is the best work around for this issue?
And I obviously don't have a stack trace, because my users are using it DO NOT use Adobe Flash Player debugger, however this person and posts seem to be exactly same issue and they have stack trace: http://forums.adobe.com/message/3410527
I have also submitted this issue to Adobe BugBase: https://bugbase.adobe.com/index.cfm?event=bug&id=3101786.
Thanks
can you add to your code the UncaughtErrorEvent.UNCAUGHT_ERROR listener on the main movie loaderInfo object? If you can then it should intercept this error and you can collect some information about it or just ignore it if it doesn't break your application.
best regards

Categories

Resources