Why is MediaRecorder.prepare() throwing an IOException? - android

I am just trying to make a simple video recording app. I have spent days trying to figure this error out and I have had no luck. I am so close to just deleting my whole computer, this error is driving me mad! I followed developer.android.com and YouTube tutorials. I can't see why my code doesn't work as I copied everything they did.
http://pastebin.com/q84v81hG
I put all the code in a paste bin because the code messes up when I put it here.
Thanks for any help!
BTW I am aware I haven't added a button that stops recording, I am just trying to get it recording in the first place before I add that.

Related

How do I debug "Getting your selection..." in Android Auto

I forked Timber (https://github.com/naman14/Timber), and I am trying to add Android Auto support. I got the app showing up on the virtual head unit, and I can select a song, and it plays. However, instead of showing progress and playback controls, it shows "Getting your selection..."
Now the question is: how do I debug it. As far as I can see from the point when I click on the song, to a few minutes later there are no relevant errors in Logcat. So how can I get some idea of what's going wrong? What does Android Auto is expected to do in that scenario that my app might not be fulfilling?
P.S. this is similar to another question on the same issue, however replacement of Context from this to getBaseContext() does not help, and I am actually curious what is the right way to debug this.

Stuck on layout format

Recently did a refreshers course in Android. I see that they changed a lot with the update. I have run into a few problems which I hope someone can help me figure out. The course gave me this code to be able to add in a button and make it activate for Android. However, this code is slightly outdated and I have attached the screenshot of the code I tried to fix according to what Andriod wants. think most of the problem is that with the new andriod sutidio I am working with this layout :androidx.constraintlayout.widget.ConstraintLayout
I would like to know in the ain activity how can I fix the problem in the screenshot attached to get this right. Please help because I can't move forward until I figure out the problem. I would like to know how do I change the "R" to the right code for constraint layout.
If you have error of R, then follow below steps.
Go to File menu in android studio and click on Invalidate cache / restart option.
Then clean your project.

In-app link to Facebook page leads to error screen

I have an icon within my app that links to my fan page. It was working fine before but since around 2 weeks ago, whenever someone clicks on the icon, they get to an error page saying: “Trouble Loading Timeline”. It also says “Tap to retry” but nothing happens when they do.
Although I’m using the same source code for both (because of Unity3D engine), this happens only for Android, not iOS. I didn’t have this issue after my last update but it started happening suddenly a few weeks after. I didn’t make any changes in my source code in the last few weeks.
Would anyone know what the issue is and how to fix it?
Thanks

Show progress of file sending

Im sending files to my server from my android device, and would be great to get some feedback on how the file process is working out. For example in percentage.
Just that im leaving home for a couple of days and i would like to get right on it when i get back home becuase my time is running out. So would be great to return home with some descent tips right away :)
I think the following link has exactly the codes that you are looking for. A sample application that shows the progress of downloading a file:
http://www.java-samples.com/showtutorial.php?tutorialid=1521
There are 2 ways to do it:
Use a Handler
Use an AsyncTask

android videoview - managing bad urls error?

Im using some time expiring url to watch a video from internet and so, when the expiration time come out, the video is not working anymore. In this case, im getting an error dialog box from the videoplayer saying the video is unreadable. that is quite fine, but i would like to display my own dialog box text. how can i do ? is there any way i can know my video didnt work ? Any ideas ?
I found the answer my self reading a bit more the SDK. There is setOnErrorListener(android.media.MediaPlayer.OnErrorListener).
that you can create. :)

Categories

Resources