[Q] sg3 record video code problem - Android Q&A, Help & Troubleshooting

Hello,
im tring to make app that recod video from the front camera
i have a code that work in all devices that i know but not in sg3
dose any1 know how to record video with the camera in sg3?
this is my record code:
mMediaRecorder = new MediaRecorder();
mMediaRecorder.setCamera(mRecoredCamera);
mMediaRecorder.setAudioSource(MediaRecorder.AudioS ource.MIC);
mMediaRecorder.setVideoSource(MediaRecorder.VideoS ource.CAMERA);
int qualty = getSharedPreferences(Consts.SHERD_PREF_FILE, MODE_PRIVATE).getInt(Consts.SHERD_PREF_QUALITY, 0);
switch (qualty) {
case 1:
qualty = CamcorderProfile.QUALITY_LOW;
break;
default:
qualty = CamcorderProfile.QUALITY_HIGH;
break;
}
mMediaRecorder.setProfile(CamcorderProfile.get(qua lty));
mMediaRecorder.setOutputFile(fileName);//"/sdcard/video.mp4");
mMediaRecorder.setPreviewDisplay(mSurfaceHolder.ge tSurface());
mMediaRecorder.setMaxDuration(60000);
mMediaRecorder.setMaxFileSize(10485760);
mMediaRecorder.prepare();
mMediaRecorder.start();
this is the exception im getting:
java.lang.RuntimeException: start failed.
at android.media.MediaRecorder.start(Native Method)

Questions should be posted in Q&A forums, not Development forums.
http://forum.xda-developers.com/announcement.php?a=81
See rule #15
Thread moved.

Related

[Q] Best way to receive gps state change for enabled/disabled

Hi,
is there a better way to receive ONLY the enabled/disabled state change for GPS
than go with LocationListener ? I have read, the LocationListener needs some
battery life, which is some useless if so.
Is there really no action / intent to receive for or i'm blind to find that in documentation?
thanks for help
Andy
I'm in the process of testing an app that uses LocationManager.
First, take a look at the Criteria class. Here you can provide some settings, one of which is "setPowerRequirement". This can help with battery life.
Next is the call to "requestLocationUpdates" which includes a time and distance. Time is in milliseconds, distance in meters. The developer guide suggests setting time to no lower than one minute to conserve battery.
I've run this for about 3 hours on the road and the battery use for my app seems fine; it's not sucking the life out of the battery. Maybe I'll go against the developer guide and set it to one second, 10 feet and go for a drive (see my "final" note LOL) and see what that does to the battery.
Found this little snippet that may be of use to you:
Code:
GpsStatus.Listener gpsListener = new GpsStatus.Listener() {
public void onGpsStatusChanged(int event) {
if( event == GpsStatus.GPS_EVENT_FIRST_FIX){
showMessageDialog("GPS fixed");
}
}
};
Finally, a note about writing a LocationManager app...THEY'RE A ***** TO TEST!! ROFL
Rootstonian said:
I'm in the process of testing an app that uses LocationManager.
First, take a look at the Criteria class. Here you can provide some settings, one of which is "setPowerRequirement". This can help with battery life.
Next is the call to "requestLocationUpdates" which includes a time and distance. Time is in milliseconds, distance in meters. The developer guide suggests setting time to no lower than one minute to conserve battery.
I've run this for about 3 hours on the road and the battery use for my app seems fine; it's not sucking the life out of the battery. Maybe I'll go against the developer guide and set it to one second, 10 feet and go for a drive (see my "final" note LOL) and see what that does to the battery.
Found this little snippet that may be of use to you:
Code:
GpsStatus.Listener gpsListener = new GpsStatus.Listener() {
public void onGpsStatusChanged(int event) {
if( event == GpsStatus.GPS_EVENT_FIRST_FIX){
showMessageDialog("GPS fixed");
}
}
};
Finally, a note about writing a LocationManager app...THEY'RE A ***** TO TEST!! ROFL
Click to expand...
Click to collapse
thanks for answer,
i've seen these code on stackoverflow already, but it means more the fixed GPS position optimization to save battery power
I only need the events when gps is enabled or disabled, not more
I would use the code above and then call:
public static final int GPS_EVENT_SATELLITE_STATUS
Since: API Level 3
Event sent periodically to report GPS satellite status. Call getSatellites() to retrieve the status for each satellite.
Constant Value: 4 (0x00000004)

[Q] What does KeyBoxProvision.apk do?

I have a new Asus Transformer Prime & I love it. I am trying to clean up some of the unnecessary preinstalled items.
What does KeyBoxProvision.apk do?
According to Google, "KeyBoxProvision" only shows up on 3 pages on the entire net: one post noting that it was running, and two dumps which indicate it was included in a long list of things distributed in the 9.4.2.11 update. None of this includes any information about it.
KeyBoxProvision runs all the time and quickly starts back up if terminated. "Settings|Apps|All" lists KeyBoxProvision as an application. It may be "Force Stop"'d, but it soon starts back up again. The "Disable" function is unavailable. KeyBoxProvision has just about every permission available on Android. It can do just about anything on the tablet.
So, does anyone know what KeyBoxProvision does, if it's safe to get rid of it, and how one would get rid of it?
Thanks,
Stephen
I don't know off the top of my head, and I personally wouldn't remove it. Nonetheless if you are feeling adventurous:
Go into the system/app folder,
Copy the apk and odex file to another location for safe keeping.
Then delete both of them from the app folder.
It goes without saying that you are going to have to be rooted to make this happen. If you start getting errors/force closes, put them back.
Sent from my Transformer Prime TF201 using xda premium
KeyBoxProvision.apk is the service that handles OTA update checking. It's also where the issue occurs for the "serial not found" issues:
Code:
public void onCreate()
{
Log.d("KeyBoxService", "=== onCreate()");
super.onCreate();
if (hasLibrary)
{
this.thKeyBox = new HandlerThread("KeyBoxOTAThread");
this.thKeyBox.start();
this.hKeyBox = new KeyBoxHandler(this.thKeyBox.getLooper());
KeyBoxSettings.init(this);
this.mSettings = KeyBoxSettings.getInstance();
String str;
if (Build.SERIAL != null)
str = Build.SERIAL;
else
str = "unknown";
this.mClientId = str;
this.mPasscode = TextUtils.escape(AuthUtils.getPasscode(Build.SERIAL, "AsusWvDrmServer"));
}
else
{
stopSelf();
Log.e("KeyBoxService", "No library loaded, stopSelf!");
}
}
So in theory, if you remove this service all OTAs should stop. Not sure if any other app relies on this service for its functionality though (as it offers a variety of utilities; SHA1 hashing for auth, Base64 encoding, etc).
My guess is you end up bootlooping. I have no clue but I would be nervous messing with it.

[Kernel][Drivers]Tweaking the camera Driver(for 60FPS Video) Kernel developers needed

I think that this is something important to talk about. Enabling 60 FPS at video recording should improve the video by a lot and would be useful for capturing objects in movement.
There is a mod for the camera of our GS3 where 60 FPS is enabled but it is not working yet, and maybe is because of a driver limitation.
I'm studying the camera driver very carefully. I set the frame rate to high numbers only for testing purpose. I will keep looking for more about this. There should be a way on how to extract the firmware GD and ZD.
*Edit*
I need to know how to open SlimISP_GD.bin.ihex and SlimISP_ZD.bin.ihex in order to edit the Firmware but it seems that it is not possible to convert the hex file to "readable" language. It seems to be encrypted or something like that. If anyone know how to do this, please let me know.
>sensor.sensor_type) {
case SENSOR_S5K3H2_CSI_A:
case SENSOR_S5K3H2_CSI_B:
max_framerate = 15; SET TO 120
break;
case SENSOR_S5K3H7_CSI_A:
case SENSOR_S5K3H7_CSI_B:
max_framerate = 30; SET TO 120
break;
case SENSOR_S5K6A3_CSI_A:
case SENSOR_S5K6A3_CSI_B:
max_framerate = 30; SET TO 120
break;
case SENSOR_S5K4E5_CSI_A:
case SENSOR_S5K4E5_CSI_B:
max_framerate = 30; SET TO 120
break;
default:
max_framerate = 30; SET TO 120
}
return max_framerate;
}
Click to expand...
Click to collapse
I need help from developers with knowledge in Kernel/ROM/Driver developing. I am not able to compile the Kernel properly yet, so I would be VERY grateful if someone with experience did it. Me and many people could benefit from this (if this works).
I attached the drivers with the corresponding modifications.
If I did any mistake writing this, please let me know. English is not my first language.
Can any moderator move this to the Galaxy SIII Android Development?
Thanks in advance!
+1

[Q] Query on MediaStore.Audio.Playlists Keeps Empty

To get a list of all playlists, I do the following:
Code:
String[] projection1 = { MediaStore.Audio.Playlists._ID, MediaStore.Audio.Playlists.NAME };
Cursor cursor = myActivity.getContentResolver().query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, projection1, null, null, null);
On my JellyBean device (API16), every thing works fine. Subsequent queries on contained songs in each playlist also works as expected.
On my Gingerbread device (API10), the resulting cursor keeps empty, despite having created several playlists in the standard music player.
Are playlists stored differently in older APIs? Or has DB structure changed? Querying the audiofiles (MediaStore.Audio.Media.EXTERNAL_CONTENT_URI) works well on both devices. I'm compiling with min. API 8.
Any hint would be greatly appreciated!
*ping*
Seriously, nobody has an idea?
(Could an admin please put this thread into the right forum, as I am not yet allowed to. Otherwise, I doubt it has a chance of being read by the relevant audience. Thanks!)

Amazon Fire Phone Video and sound problem

i know am not suppose to open a new thread if there is an old one already available, but the issue is that the old thread is so old that no one replies there anymore and i have been waiting for a reply for a couple a days now..
as you all know that the amazon fire phone has couple of issues that has new been fixed by the company itself and i have been searching around for fixes myself and one of the main issue that has been bothering all fire phone users is the video not being able to play in apps like whatsapp, instagram, snap etc..
now i have come across this one particular coding for this issue but since am not a developer or a java expert i need assistance in preforming these steps and if anyone can be helpful enough to tell me whether this works or not
In AmazonQuirks.java
private static final String FIRE_PHONE_DEVICE_MODEL = "SD";
private static final boolean isFirePhone;
static {
isFirePhone = isAmazonDevice && DEVICEMODEL.startsWith(FIRE_PHONE_DEVICE_MODEL);
.
.
}
public static boolean isLatencyQuirkEnabled() {
// Sets latency quirk for Amazon KK and JB Tablets
return ( (Util.SDK_INT <= 19) && (isKindleTablet || isFirePhone) );
}
by reddisri on github
https://forum.xda-developers.com/fire-phone/help/help-thread-question-noob-friendly-t3216271/page6

Categories

Resources