Mediaplayer error (-19,0) after repeated plays

I have a game in which a sound plays when a level is completed. Everything works fine to start with but after repeating a level 10 or 20 times the logcat suddenly reports:"MediaPlayer error (-19,0)" and/or "MediaPlayer start called in state 0" and the sounds are no longer made.I originally had the all sounds in mp3 format but, after reading that ogg may be more reliable, I converted them all to ogg, but the errors appeared just the same.Any idea how I can fix this problem? I think you are not releasing the mediaplayers you are using to play the sound..You need to release...

How to convert this file into an MP3 or is it already defined as MP3?

here's my code but there's no sound being playedMainActivity.javapublic class MainActivity extends AppCompatActivity {private MediaPlayer mediaPlayer;@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mediaPlayer = MediaPlayer.create(MainActivity.this,R.raw.file); Button playButton = (Button) findViewById(R.id.play_id); playButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mediaPlayer.start(); ...

adb shell su works but adb root does not

I rooted my unlocked Galaxy S3 (SGH-T999)Now, I'm trying to run adb root from Windows Command Prompt, however, I'm getting adbd cannot run as root in production builds error. So, the very first thing I checked was whether my phone was really rooted?So I tried the following:Open Command prompt$adb devices // lists my device$adb shell //goes to shell$su // opens a 'SuperSu' prompt on my phone and I 'Grant' permission# // Before following the rooting instructions, I was getting 'no su command found' in the previous step. So, I believe my phone is ROOTED. **Correct me if I'm wr...

'mono shared runtime' always deployed to android device

I'm trying to create an APK using xamarin.android & visual studio 2012, but the option for 'package ... apk file' is disabled - and i believe this is a bug as described here: (https://bugzilla.xamarin.com/show_bug.cgi?id=10530).However, an apk is still created when deployed to a device, the problem is i only want one APK which contains everything (so i can deploy it via a web server), but when building this way, even in release with 'use shared runtime' unticked, 'mono shared runtime' is still installed on the device. I've created an issue on it here: (https://bugzilla....

Onscroll gesture in all direction(Left,Right, Up, Down )

I need to detect swipe direction. In my code I can detect the direction, but it comes like, if I swipe right top right or left-top like that coming. same for the left, my requirement is without lifting a finger if I swipe left it should come only left, likewise all the directions. Can anyone help me out. Thanks in advance!Here is my code @Override public boolean onScroll(MotionEvent event1, MotionEvent event2, float distanceX, float distanceY) { if (Math.abs(deltaX) > Math.abs(deltaY)) { if (Math.abs(deltaX) > MIN_DISTANCE) { if...

Can we port the .NET Compact - Windows CE application to Xamarin application for Android platform?

I have a query regarding the .NET Standard 2.0 implementation. As per my current understanding, the existing applications developed using a .NET framework (Traditional BCL) can be able to port into Xamarin based application for Android platform. Likewise, can we port the existing application developed using .NET Compact Framework for Windows CE to Xamarin application for Android Platform? How much feasibility is available in API prospect? Please let me know answers. .NET 2.0 Standard contains more APIs than .NET CF. The UI will not be transferable at all, you will need t...

Android Azure Offline Sync - Not completing sync

I have an android app with Azure Mobile Services and implemented Offline Sync. The app works well but when syncing data it seems not to complete so there is always a few rows on tables which have not synced?Anyone have any ideas what the problem might be. I believe that on the next try it would finish where it left off or am I wrong?Thanks in advance The app works well but when syncing data it seems not to complete so there is always a few rows on tables which have not synced?I would recommend you use fiddler to capture the network traces when handling the sync operati...

How to open youtube channel page in webview

I know that this question has been asked several time and I had tried several answers but none of them has helped me. I've tried the following answers - html video not playing in android webviewYouTube Video not playing in WebViewYouTube Video not playing in WebView - Androidand many others too. I'm opening a youtube page in my app and the page is showing fine. But when I'm clicking on the video it doesn't play video, I'm only getting the audio. Note - I don't want to play a single video using iFrame like others have done. My requirement is to display a youtube page inside ...

Issues recreating a material design lists with leave behind in Android

I'd like to recreate the Material Design list: controls in Android inside a sliding panel.I'm making use of:com.android.support:appcompat-v7com.android.support:support-v4com.android.support:recyclerview-v7com.android.support:designhttps://github.com/umano/AndroidSlidingUpPanelhttps://github.com/serso/android-linear-layout-managerhttps://github.com/daimajia/AndroidSwipeLayouthttps://github.com/tmiyamon/gradle-mdiconsI ended up using portions of the support libraries, but this specific app is 5.0+ only so there may be some Lollipop-only stuff in my code.Here is the layout for...

Playing sound class in different classes Android

I am having some trouble calling methods from my SoundManager class in another of my classes. Here is the SoundManager class.public class SoundManager {private SoundPool soundPool;public static final int maxSounds = 2;AudioManager audioManager;private int[] soundId;private Context context; //= mGame.getActivity().getApplicationContext();Game mGame;public SoundManager(Game game) { super(); context = game.getActivity().getApplicationContext(); //this.mGame = game; soundPool = new SoundPool(maxSounds, AudioManager.STREAM_MUSIC, 0); if (Build.VERSION.SDK_INT >...

NativeScript: how to style a listview itemTemplate

I have the following NativeScript code:<Page loaded="onPageLoaded"> <GridLayout rows="auto, *"> <ListView items="{{ items }}" row="1"> <ListView.itemTemplate > <Image url="{{ url }}" /> </ListView.itemTemplate> </ListView> </GridLayout></Page>I would like to style the ListView-Item, giving it a padding so each image has a little bit of whitespace around it. I tried giving it a class and style the class in the css but I wasn't able to change it.I was however able to...

Using Loaders managing Cursors

I write an Android app and asking myself how to manage cursors. I know how to get data through a cursor back from the database. I don’t want to handle the lifecycle of these cursors by myself.For Android 2.x and below I used, according to the Android API, methods like managedQuery and startManagingCursor. These methods are now deprecated. Instead of these methods I should use the Loader class for example (CursorLoader). As far as I know CursorLoader must be backed by a ContentProvider. The Android SDK recommends ContentProvider only if I want to share my data. But I just w...

How to affect Delphi XEx code generation for Android/ARM targets?

Update 2017-05-17. I no longer work for the company where this question originated, and do not have access to Delphi XEx. While I was there, the problem was solved by migrating to mixed FPC+GCC (Pascal+C), with NEON intrinsics for some routines where it made a difference. (FPC+GCC is highly recommended also because it enables using standard tools, particularly Valgrind.) If someone can demonstrate, with credible examples, how they are actually able to produce optimized ARM code from Delphi XEx, I'm happy to accept the answer.Embarcadero's Delphi compilers use an LLVM backen...

Button's textColor won't change in Android

I want to change my button's text color when the state of the button changes. For example, when the button is disabled, I want the color the be grey, when it is enabled, I want it to be white and so on. So, to achieve this, I did this in my styles.xml file:res/drawable/styles.xml<style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> .. <item name="android:buttonStyle">@style/AppTheme.Button</item> ..</style><style name="AppTheme.Button" parent="android:Widget.Button"> <item name="android:background">@drawabl...

enable extension in opengl es

I had done a program that worked. There was in a rendering in framebuffer attached to a texture in float32. For this fact, I activated an extensionvar ext = gl.getExtension ("OES_texture_float"); //weglblvar ext = gl.getExtension ("EXT_color_buffer_float"); webgl2the blend was activated: gl.enable (gl.BLEND);gl.blendFunc (gl.ONE, gl.ONE);which made it possible to add components (which represented particle speeds)I am doing the same thing but with opengl es 3.0 :The RTT works well, however it is at the level of the blend that I have an error :GLES32.glEnable(GLES32.GL_BLEND...

Change color of the background

This is my app: https://ibb.co/jgpfCaI want to make the black color to be white, but it seems like i can't find the way to change it.I want to change it to white because when i'm applying a content padding in my recyclerview it shows the black colors in the backgroundHere's my xml:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_co...

Page 1 of 831  |  Show More Pages:  Top Prev Next Last