Post by rveerd on Mar 2, 2018 14:58:05 GMT
We have an old app that uses the Camera API. The app was build with RMS 5.4.
We had to make some unrelated changes to this app so we migrated it to RMS 5.5. This all works except for the Camera API.
Our code:
When I run this app and try to take a picture, the camera apps is not even shown. The callback is called with `params` equal to `null`. I see a null-pointer exception in the logs. I guess from within the Camera extension. See attached log file abd-logcat1.txt, around 14:37:46:811.
When I comment out the line with the `outputFormat` parameter, the camera app is shown and I can take a picture. However I cannot confirm the app with OK/check mark but I can only cancel it with Cancel/cross. In this case the callback is called with `status` equal to `cancel`. See attached log file adb-logcat2.txt at the end.
AFAIK only RMS has changed from 5.4 to 5.5.
Any ideas for a fix or a work-around?
Build environment:
- Windows 7
- RMS 5.5 using command-line
- Android SDK build-tools 22.0.1
- Android SDK 5.1.1 (API 22)
- build.yml android:version: "2.3.3"
- build.yml extensions: mediacapture
- build.yml capabilities: camera
Target device:
- TC55, Android 4.1.2 and 4.3.1
Note: we haven't tried RMS 6.0 as we have not gotten it to work, we have experience with 5.5, it is an old app and it is an old device.
We had to make some unrelated changes to this app so we migrated it to RMS 5.5. This all works except for the Camera API.
Our code:
instance.makePhoto = function () {
var userFolder = Rho.Application.userFolder;
var photoPath = Rho.RhoFile.join(userFolder, 'PHOTO');
Rho.Camera.takePicture({
fileName: photoPath,
desiredWidth :640,
desiredHeight :480,
flashMode: "auto",
outputFormat:Rho.Camera.OUTPUT_FORMAT_DATAURI
}, instance.pictureTakenCallback);
};
instance.pictureTakenCallback = function (params) {
console.log("pictureTakenCallback: params=", params);
// ...
};
When I run this app and try to take a picture, the camera apps is not even shown. The callback is called with `params` equal to `null`. I see a null-pointer exception in the logs. I guess from within the Camera extension. See attached log file abd-logcat1.txt, around 14:37:46:811.
When I comment out the line with the `outputFormat` parameter, the camera app is shown and I can take a picture. However I cannot confirm the app with OK/check mark but I can only cancel it with Cancel/cross. In this case the callback is called with `status` equal to `cancel`. See attached log file adb-logcat2.txt at the end.
AFAIK only RMS has changed from 5.4 to 5.5.
Any ideas for a fix or a work-around?
Build environment:
- Windows 7
- RMS 5.5 using command-line
- Android SDK build-tools 22.0.1
- Android SDK 5.1.1 (API 22)
- build.yml android:version: "2.3.3"
- build.yml extensions: mediacapture
- build.yml capabilities: camera
Target device:
- TC55, Android 4.1.2 and 4.3.1
Note: we haven't tried RMS 6.0 as we have not gotten it to work, we have experience with 5.5, it is an old app and it is an old device.