MediaStore.ACTION_VIDEO_CAPTURE issuewith HTC desire - video-capture

I am attempting to use the MediaStore.ACTION_VIDEO_CAPTURE in my app, see code below.
However, there seems to be an issue with it on the HTC desire.
When the video capture intent launches, everything is fine, but as soon as the round button for record is pressed, or any of the UI interacted with in fact, the intent hangs. Logcat doesn't throw any errors, but whenever I attempt to interact with the phone it posts " UI Block".
I am able to quit the application with the home button, but after this the camera is unaccessable, the app cannot rund on the phone again -untill the device has been reset. Ive tried the app on a HTC sensation where it worked without problems. I think it might be an issue with the HTC Sense UI, but I am not sure. Code as follows:
case R.id.VCF_Btn_record:
Intent captureVideoIntent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(captureVideoIntent, VIDEO_CAPTURED);
MediaStore is API level 1, and ACTION_VIDEO_CAPTURE API lvl 3, so it should work on this device, has anyone else experienced anything similar?

Here is the code that I'm using in my app, which works perfectly fine on my Desire:
private void captureVideo() {
Intent i = new Intent("android.media.action.VIDEO_CAPTURE");
try {
startActivityForResult(i, CAPTURE_VIDEO);
} catch (ActivityNotFoundException ex) {
Toast.makeText(this, "Your device does not contain an application to run this action", Toast.LENGTH_LONG).show();
}
}
I know that android.provider.MediaStore.ACTION_VIDEO_CAPTURE resolves to "android.media.action.VIDEO_CAPTURE", but if I recall when developing my app, using it didn't work for me.
See if that works for you

Related

Take pictures using camera shutter when receiving live view data

I am developing using EDSDK.
However, if I press the shutter of the camera (physical button) while receiving live view data(EVF Mode), the picture won't be taken. Is this normal?
My camera model is 200D II.
What I'm trying to do is as follows, and it's very simple.
My software activates the camera through EDSDK and receives live view data.
The person behind the camera takes a picture by pressing the camera shutter, and my software shows the picture on the screen.
The questions are as follows.
How to take pictures using physical camera shutter buttons when receiving live view data(EVF).
HDMI connections are not considered because there are features that need to be controlled directly through EDSDK.
Thank you.
Below is what I added after Johannes Bildstein's answer.
As Johannes Bildstein answered, the following code was inserted to unlock the UI.
But it still hasn't been solved.
if (!MainCamera.IsLiveViewOn) {
MainCamera.StartLiveView();
MainCamera.UILock(false);
}
Error message occurs when I try to unlock UI and get EVF data. (Shutter still doesn't work)
If I unlock UI after receiving EVF data,
When dial is in photo mode: EVF data is coming in, but the shutter still does not work.
When dial is in video mode: EVF data does not come in due to BUSY error. Is it a conflict due to UI unlocking? We check your answers and SDK documents and try in many ways, but they are still unresolved. We are currently testing the more recent model, 200D II.
"| EvfOutputDevice.Camera " should be added like below!
public void StartLiveView()
{
CheckState();
if (!IsLiveViewOn) SetSetting(PropertyID.Evf_OutputDevice, (int)(EvfOutputDevice.PC | EvfOutputDevice.Camera ));
}
The camera "UI" is probably locked. The EDSDK does that automatically when connecting and before doing certain commands. You can unlock it with EdsSendStatusCommand using kEdsCameraStatusCommand_UIUnLock.

one place to catch all sudden exceptions in titanium?

I am new to Titanium Android App development and going through an unpleasant scenario of "Network goes off" during use of my app.
I tried reproducing it on my emulator, but going "Airplane mode" while app still working.
I tried below in app.js:
Ti.App.addEventListener('uncaughtException',function(){
alert("caught"); });
Ti.App.addEventListener('TiException',function(){
alert("caught:Ti"); });
So good thing is I am able to see "caught" but not before my app sees a red screen detailing and it breaks. see image:
App crash error
it would be very helpful if someone can help me out in identifying how to catch all those 'unplanned' exceptions and direct them as per some business logic so that user doesnot see those blasts.
Thanks in advance
The exception that you are seeing is related to LiveView. See the docs here: http://docs.appcelerator.com/platform/latest/#!/guide/LiveView which is totally unrelated to the code on the app.
If you are going to test offline mode in your app you need to run it without LiveView because it requires connectivity to work.
For reference:
The event that catches all the exceptions is uncaughtException
TiException is not a valid event so it will never be triggered.

Xamarin forms win phone silverlight 8.1 Toast notifications not working

I am trying to make a toast notification show in a Xamarin Forms, windows phone 8.1 silverlight project. Inside the Windows Phone project I have a method that creates a toast notification, however, nothing happens when it is executed. No error is thrown everything seems to execute correctly but nothing happens on the phone.
I have tested it on an emulator and an actual cell phone. Everything I have found online until now is practically the same as what I have (with slight differences, but nothing that should make a difference).
The code in the method is the following:
private void CreateNotification(string title, string message)
{
ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier();
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
toastTextElements[0].AppendChild(toastXml.CreateTextNode(title));
toastTextElements[1].AppendChild(toastXml.CreateTextNode(message));
ToastNotification toast = new ToastNotification(toastXml);
toast.ExpirationTime = DateTimeOffset.UtcNow.AddSeconds(5);
toastNotifier.Show(toast);
}
Any help would be greatly appreciated.
Thanks in advance!
If you are using Xamarin Forms there is a NuGet package: https://www.nuget.org/packages/Toasts.Forms.Plugin/
It doesn't use the standard toast notification system in windows phone though as it needed to expand beyond it.
As for showing Toast Notifications have you set Toast Capable to Yes in your Package.appxmanifest?

Worklight persistent busy indicator

I'm working on a project using IBM Worklight and any time I build and deploy my project on any simulator or device, I have this busy indicator spinner in the middle of the screen. Its always there, on every page and its there in the ios, windows, web and android simulators as well as one android device we've tested on. Has anyone seen this before and if so how would I get rid of it.
Jquery-mobile was the problem, it was continuously displaying the indicator for seemingly no good reason. Deleting Jquery mobile fixed the problem
I already used the native worklight loading.It is very good and I tested it on different platforms, devices. But it is necessary to close it when you leave the function that opened it.
Example:
var busyInd = new WL.BusyIndicator ("content", {text: "Please wait..."});
function consult(){
busyInd.show();
//impl
busyInd.hide();
}

How to verify redirection to Google Play Store

Using Robotium, how do I check the redirection to Google Play Store?
Steps:
Click on a link from a listview from the test app.
Verify it redirects to Google Play Store.
I noticed that while Google Play Store is open, my test app is actually open underneath also. (I printed out all the views)
Therefore, I cannot do "assert xyz view from test app does NOT exist".
How do I check the redirection to Google Play?
Is it possible? sort of, unfortunately robotium makes it very hard to do so easily, this is because of the way that robotium tracks what the current activity is, if you was using straight instrumentation it would be as easy as having an intent filter set up before you click the view/perform action that launches the play store, then you can assert that your filter has in fact been hit (which proves that the google play store would in fact be launched if you did not have the filter).
As you are using robotium though, you cannot do this so easily as robotium has already got an intent filter up that matches everything so this means you are going to have to do some horribleness with reflection.
What you will need to do is:
Get Hold of the private member of the instrumentation class called mActivityMonitors, in this list of activity monitors you will find there is one inside of it, this will be robotiums activity monitor, save this somewhere then remove it from the list.
You will then need to add your own it will look something like to test googleplay launches (i suggest reading about Intent filters on the android api documents site)
Instrumentation inst = getInstrumentation();
IntentFilter intentFilter = new IntentFilter(Intent.ACTION_View);
ActivityMonitor monitor = inst.addMonitor(intentFilter, null, true); //true is imporant it blocks the activity from launching so that your test can continue.
assertEquals(0, monitor.getHits());
//do action that fires activity
assertEquals(1, monitor.getHits());
inst.removeMonitor(monitor);
You will now need to readd the activity monitor you removed earlier so that robotium continues to work as expected. I am not on a machine that i can actually test this all on but i have used this technique before.