App Inventor and Java


Take Pictures programmatically using the Activity Starter calling a Java app

Note: with the extension feature, this workaround is now obsolete. Thank you MIT!
Now you can use my Camera Extension instead.

With the App Inventor built-in camera component it is currently not possible to take pictures programmatically without user intervention, see also issue 323.

I now created the Java app Take Picture as workaround for issue 323. You can start it from within App Inventor with the Activity Starter to take a picture (without shutter sound) programmatically. The path to the image will be provided in the ActivityStarter.AfterActivity event back to App Inventor.
Thank you Easy Android Tutorials
for the basic source code I'm using for this solution. (Link to Easy Android Tutorials unfortunately broken).

With the help of Take Picture, the App Inventor example app Take Picture Test shoots max. m pictures (configurable in textbox 'max. number') every n seconds (configurable in textbox 'interval in sec') programmatically without user intervention and stores them on SD card in a seperate directory configurable in the Take Picture Java app.
After recording, the taken pictures will be displayed in a kind of "time-lapse video".

You can download the Take Picture Java apk I created and use it together with your App Inventor project.
Note: The App Inventor example app "Take Picture Test" works only, if the Java app Take Picture is installed on your device.

For questions about App Inventor,
please ask in the App Inventor community.Thank you.

Screenshots

Take Picture (Java app)

Take Picture Test (App Inventor app)

App Inventor blocks

Take Pictures



Display Recorded Pictures


Test

Tested successfully on HTC Desire running Android 2.2 and Samsung Galaxy Tab 10.1N running Android 3.2.

Creative Commons License
This work by Pura Vida Apps is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
with attribution (name=Pura Vida Apps and link to the source site) required.


Home | Snippets | Tutorials | Extensions | Links | Search | Privacy Policy | Contact