[Q] Track seekbar scrub past markers? - Android Q&A, Help & Troubleshooting

I am currently working on a video player using the VideoView and I am controlling it with the MediaController. There are two things I am currently trying to figure out how to approach and was hoping someone may have some ideas.
The first thing I would like to do is to be able to place markers along the seekbar, such as 25% of the clip. I want to fire an event when this mark is hit or scrubbed past. Throwing an event when this marker is hit with the video playing regularly will be easy because I should be able to just use getCurrentPosition and checking to see if it is 25% of the total clip. The issue I am having is how to fire the event if the user scrubs past the 25% point.
The second thing I am trying to do is just show a visual marker along the seekbar that I can display a marker, lets say at the 25% point, 50% point, etc. Any help or direction would help immensly. Thanks!

In looking at this a bt more, with regards to tracking when the user scrubs past certain markers, I am thinking that if I can reference the MediaControllers seekbar object and get its ontouch down and up events, then I could perform a calc to see if those points were passed.
The issue I am having now is how I can get access to my subclassed MediaControllers seekbar. Does anyone know if this is possible and if so how to go about getting the id of it?
I currently have extended the MediaController so I could show it on the screen at all times, but havent figured out how to get access to the seekbar object in the MediaController. Any ideas?
Code:
package org.apache.android.media;
import android.content.Context;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.MediaController;
public class VisibleMediaController extends MediaController{
public VisibleMediaController(Context context)
{
super(context);
}
@Override
public void hide()
{
this.show(0);
}
@Override
public void setMediaPlayer(MediaPlayerControl player) {
super.setMediaPlayer(player);
this.show();
}
}

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.

App needed

Does anyone have the original Kik messenger XAP? i want to download it again but since they deleted it from the store i can't get it that way and every xap i get for it are corrupted and or won't install.. Thanks
View attachment Kik_Messenger.xap
spavlin said:
View attachment 4438984
Click to expand...
Click to collapse
You are my favorite person right now THANK YOU!! <3 <3 <3 it works!!
late reply email didn't notify me and xda didn't either Lol
texas7412 said:
You are my favorite person right now THANK YOU!! <3 <3 <3 it works!!
late reply email didn't notify me and xda didn't either Lol
Click to expand...
Click to collapse
I copied this file to my sd card on my lumia 535 and tried to install it through file explorer, a message pops up saying "Would You like to install Kik Messenger from Kik Interactive" I press the install button and nothing happens, it just goes back to the file list. hmmmm I have turned on app sideloading in settings. But im clearly doing something wrong somehwhere.
use XAP deploy from PC
https://forum.xda-developers.com/wi.../tutorial-deploy-xaps-easily-wpv-xap-t3263968
dxdy said:
use XAP deploy from PC
https://forum.xda-developers.com/wi.../tutorial-deploy-xaps-easily-wpv-xap-t3263968
Click to expand...
Click to collapse
Thanks for that.
I managed to get the App installed, it loads fine, but I get this error when logging in:
Login Failed: This is taking longer than it should, You should try again in a bit. Same error if I try to make a new ID.
Weird, maybe it just doesn't work on Win 10 Mobile anymore, or my Lumia 535?
maybe app is too old and dont support new login
I discovered the kik servers apparently no longer connect to WP app App works fine, just not the message servers.
hmmmm that sucks...
Code:
IL_0000: ldstr "Production"
IL_0005: ldstr "simplewp.kik.com"
IL_000a: ldc.i4 0x1466
IL_000f: ldc.i4.1
IL_0010: ldstr "talk.kik.com"
IL_0015: ldstr "http://profilepicsup.kik.com/profilepics"
IL_001a: ldstr "http://profilepics.kik.com/"
IL_001f: ldstr "https://platform.kik.com/content/files/"
IL_0024: newobj instance void Kik.Phone.Core.ServerConfig::.ctor(string,
string,
int32,
bool,
string,
string,
string,
string)
IL_0029: stsfld class Kik.Phone.Core.ServerConfig Kik.Phone.Core.ServerConfig::ProductionServer
IL_002e: ldstr "Beta"
IL_0033: ldstr "betawp.kik.com"
IL_0038: ldc.i4 0x1466
IL_003d: ldc.i4.1
IL_003e: ldstr "talk.kik.com"
IL_0043: ldstr "http://profilepicsup.kik.com/profilepics"
IL_0048: ldstr "http://profilepics.kik.com/"
IL_004d: ldstr "https://platform.kik.com/content/files/"
IL_0052: newobj instance void Kik.Phone.Core.ServerConfig::.ctor(string,
string,
int32,
bool,
string,
string,
string,
string)
IL_0057: stsfld class Kik.Phone.Core.ServerConfig Kik.Phone.Core.ServerConfig::BetaServer
Code:
IL_001d: ldstr "http://piranhaws.kik.com:8080/"
IL_0022: newobj instance void [System]System.Uri::.ctor(string)
IL_0027: callvirt instance void class [mscorlib]System.Collections.ObjectModel.Collection`1<class [System]System.Uri>::Add(!0)
IL_002c: ldloc.1
IL_002d: ldstr "http://piranhaws.kik.com/"
IL_0032: newobj instance void [System]System.Uri::.ctor(string)
IL_0037: callvirt instance void class [mscorlib]System.Collections.ObjectModel.Collection`1<class [System]System.Uri>::Add(!0)
IL_003c: ldloc.1
IL_003d: ldstr "http://ws2.kik.com/"
IL_0042: newobj instance void [System]System.Uri::.ctor(string)
IL_0047: callvirt instance void class [mscorlib]System.Collections.ObjectModel.Collection`1<class [System]System.Uri>::Add(!0)
IL_004c: ldloc.1
IL_004d: ldstr "http://betaws.kik.com:8080/"
IL_0052: newobj instance void [System]System.Uri::.ctor(string)
IL_0057: callvirt instance void class [mscorlib]System.Collections.ObjectModel.Collection`1<class [System]System.Uri>::Add(!0)
IL_005c: ldloc.1
IL_005d: ldstr "http://tile.kik.com/"
IL_0062: newobj instance void [System]System.Uri::.ctor(string)
IL_0067: callvirt instance void class [mscorlib]System.Collections.ObjectModel.Collection`1<class [System]System.Uri>::Add(!0)
Instagram UWP app anyone? Mobile version has been removed from the store
maybe it would be worth looking for some other commentator, if you have such problems?
texas7412 said:
You are my favorite person right now THANK YOU!! <3 <3 <3 it works!!
late reply email didn't notify me and xda didn't either Lol
Click to expand...
Click to collapse
This , thanks for sharing.
Does anyone have the microsoft band app?

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

CameraX and Camera2Config Extender, Camera2Interop... stuck there, help needed :)

Hi all,
I1m developing a camera-using application in Java, and stuck at a point where i need to control the camera settings. Any help will be appreciated...
The main problem is that i need to lock white balance (or turn it on a fix state, as daylight, etc.). I found that there are 2 methods : Camere2Config Extender and Camera2Interop. The app needs to display a preview, and do some image analysis, which is already working. The WB control is enough to apply to the analysis, but as i understand, if i apply to the preview/config the camera, it will also affect the analyzer, as it gets the same frames.
Camera2Interop seems to be easier, but i cannot import (in Android Studio). Simply does not understand the "interop" in
Code:
import androidx.camera.camera2.interop.Camera2Interop;
import androidx.camera.camera2.interop.ExperimentalCamera2Interop;
What can i do to let the Studio import these?
Second, i tried Camera2Config.Extender. But cannot figure out how to extend the configuration, and which? The preview config seems to be the good choice.
But when i try :
Code:
PreviewConfig pConfig = new PreviewConfig.Builder().setTargetAspectRatio(aspectRatio).setTargetRotation(0).build();
Camera2Config.Extender camera2Extender = new Camera2Config.Extender(pConfig);
Preview preview = new Preview(pConfig);
I get a "error: incompatible types: PreviewConfig cannot be converted to ExtendableBuilder Camera2Config.Extender camera2Extender = new Camera2Config.Extender(pConfig);" message. It builds when i remove the Extender.
If anybody knows how to get rid of these, i'll be thankful

Categories

Resources