Trying to push the limits of App Inventor!
Snippets and
Tutorials from
Pura Vida Apps by
Taifun.
As Taifun's note indicates, what you can do related to your projected app is VERY limited.
What it can not do is take random images from your phone
... the broken Camera control
public void TakePicture() {Date date = new Date();String state = Environment.getExternalStorageState();if (Environment.MEDIA_MOUNTED.equals(state)) {Log.i("CameraComponent", "External storage is available and writable");imageFile = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),"/Pictures/app_inventor_" + date.getTime()+ ".jpg"));ContentValues values = new ContentValues();values.put(MediaStore.Images.Media.DATA, imageFile.getPath());values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");values.put(MediaStore.Images.Media.TITLE, imageFile.getLastPathSegment());if (requestCode == 0) {requestCode = form.registerForActivityResult(this);}Uri imageUri = container.$context().getContentResolver().insert(MediaStore.Images.Media.INTERNAL_CONTENT_URI, values);Intent intent = new Intent(CAMERA_INTENT);intent.putExtra(CAMERA_OUTPUT, imageUri);// NOTE: This uses an undocumented, testing feature (CAMERA_FACING).// It may not work in the future. --sorry I lost the attribution.
A useful Camera object would have:
1) Ability to list the files in any directory AI2 captures an image from Camera, Canvas, File (especially) and Web ..the controls that 'capture' images.
2) Ability to select any of the items (images) in the list in #1 from within AI2.
3) Ability to DELETE any of the items in the list in #1 from within AI2
Delete(text fileName)
- Deletes a file from storage. Prefix the filename with / to delete a specific file in the SD card, for instance /myFile.txt. will delete the file /sdcard/myFile.txt. If the file does not begin with a /, then the file located in the programs private storage will be deleted. Starting the file with // is an error because assets files cannot be deleted.
4) images should go in the DCIM folder or have it as an option
5) take and manipulate image within AI2, not using kludges and external paid for apps.