Phonegap 3.1 video capture error data is null - android

Just upgraded from android 2.9 to 3.1 and now my video capture is not working. I am working on android right now.
I have the following plugins:
camera
file
filetranfer
geolocation
mediacapture
networkinformation
My manifest permissions looks like this:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
From what I have been testing here is what happens:
The capture video opens the video recorder, even with the timelimit I
have set.
I record the video.
It gives me the okay or close, I choose okay.
It saves the video in my gallery (oddly as mp4 instead of 3gpp
which I thought was how it saved videos).
Then instead of going to the success with the mediafile it goes to
error and tells me data is null.
Here is my code to take the video --
var options = {duration: 15};
navigator.device.capture.captureVideo(checkLogin, mediaError, options);
The error message from LogCat--
Cordova Activity Request code = 2
Web Console An error occurred: Error: data is null
Any ideas would be great and if you need more info please ask,
Thank you

My reputation is not high enough yet to simply add a comment, so I'll post this as an answer. If you're still having trouble with this you may want to look at the answer to this question - Phonegap video capture crashes
Looks like modifying the java code for Capture fixed the problem for many people.

Related

Xamarin CrossGeeks Geofence Plugin null reference exception

I am using the CrossGeeks Geofence plugin found here:
https://github.com/CrossGeeks/GeofencePlugin
Using the documentation on the home page and the sample found here to build a test app:
https://github.com/domaven/xamarin-plugins/tree/master/Samples/Geofence
I encounter this error when I try to start monitoring a region:
{System.NullReferenceException: Object reference not set to an instance of an object.
at Plugin.Geofence.GeofenceImplementation.RequestMonitoringStart () [0x00000] in <793ebe419a94494388f459127f8240ff>:0
at Plugin.Geofence.GeofenceImplementation.StartMonitoring (Plugin.Geofence.GeofenceCircularRegion region) [0x00061] in <793ebe419a94494388f459127f8240ff>:0
at GeoFenceApp.MainPageViewModel.StartStopMonitoring () [0x00027] in C:\Users\ctodd\source\repos\GeoFenceApp\GeoFenceApp\MainPageViewModel.cs:87 }
The CrossGeofence object itself is not null and neither is the _myRegion object:
screenshot of cross geofence object
screenshot of region object
I believe I am initialising things correctly according to the documentation and the sample.
I'm using the following permissions, even though I believe only fine_location, coarse_location, read_gservices and boot_completed are necessary:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
A google api key is necessary in the sample because a map is being displayed, but I don't need to display a map. Do I still need this key to access location services?
After the permissions, I'm really not sure what is causing the error, as I've tried to follow the documentation.

Android app flickering

I have been writing an app that is targeted for Android 2.1 and works great on almost all devices.
Recently I tried to run it on Android 4.0.3 and it started to flicker (just like gmail app). The weird part is that I changed starting activity to empty one (no controls or layout elements) and it still flickered. Changing target to Google APIs 4.0.3 did not help either.
I am using Google APIs 2.1 currently. Have few external libraries protobuf and RabbitMQ and app permissions:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
no idea what else could have any impact to an empty Activity.
Has anyone experienced something similar or have any clue what could be happening?
EDIT: I began a new project and went step after step to replicate the problem. It is my class which extends Application and it is flooding the log with:
memalloc(26689): ion: Mapped buffer base:0x52172000 size:1949696 offset:0 fd:55
memalloc(26689): ion: Unmapping buffer base:0x52172000 size:1949696
it stops if I comment out line:
newConfig.locale = locale;
which is in method:
public void onConfigurationChanged(Configuration newConfig)
It might be that your activity is opened repeatedly?
Print your activity dump: adb shell dumpsys activity
check the stack to see how many instances are open

why don't Leadbolt Icon ads show up?

I am trying to integrate Leadbolt icon ads into an Android app. I followed the How-to guide: http://www.leadbolt.com/docs/Leadbolt_android_app_guide_v304.pdf . Here's the relevant code:
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- LeadBolt -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
The onCreate for the launcher Activity:
String leadboltIconId = Application.getInstance().getLeadboltIconId();
Log.d(TAG, "leadboltIconId: >" + leadboltIconId + "<");
AdController adController = new AdController(this, leadboltIconId, this);
adController.loadIcon();
"leadboltIconId" is filled correctly. Here is a ss of the config screen:
and the details screen:
I am using an emulator with 2.3.3 on it. It also doesn't work on my HTC Incredible with CM7 ( 2.3.3 ). There are no errors in the log. The activity implements AdListener and none of the methods are ever called.
Please change this line:
AdController adController = new AdController(this, leadboltIconId, this);
to
AdController adController = new AdController(
getApplicationContext(), leadboltIconId);
Also, please note the 3 variable is not needed when running App Icons as App icons will not trigger any event listeners. You need to use the Application Context rather than Activity for App Icons and Notifications. Activity is needed for App Ads.
I've got the same problem with the Ad Icon. I also noticed someone else posting this problem on the Leadbolt Q&A forum recently. There might be a problem with Leadbolt's side, however they fail to communicate this to us...

Android - Simple permissions - Why don't I need this permission?

I'm currently working images using
mBitmap = BitmapFactory.decodeFile(filePath);
ExifInterface exif = new ExifInterface(filePath);
My permissions are:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
I thought I needed a read storage permission to get the files from the gallery. Why can I access files from my Gallery without this permission?
If it helps, I'm using the ACTION_SEND intent filter to start the activity via a "Share" dialog.
Edit: Just to clarify, my application works perfectly. I thought I would need a special permission to read files from the SD card (such as images). Is this not the case?
this is
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Android Development: How to request permissions?

I was just wondering how to request permissions when creating an android application. I am a beginner, so please explain in simple terms :D.
So I want to make it so that my app can vibrate the phone at certain times, and the permission is called "android.permission.VIBRATE." But how do I request this? I do it in the Android Manifest file right?
Thanks for all help!
You're definately right. You need to put it in the AndroidManifest.XML
If you're using eclipse you can do it quite easily and without XML by opening up AndroidManifext.xml and use the Permissions tab at the bottom and press the "Add" button and selecting "Uses Permission" Then just select vibrate from the dropdown list.
If you want to do it in XML code you can add it before the application tag, like so:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:name="Application" >
(the rest of your manifest continues from here)
Also, please accept answers if you found them useful. With a 0% acceptance rate, people won't want to answer your questions.

Categories

Resources