• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Advice for Design and path to take

Hello:
I want to make a simple app that allows to upload an image from my device, screenshot from screenshot album for example, and add a comment to it. I am having problems since im a begginer where to start?

1- Should i use a copy of the image to be reloacted(copied) inside my app folder? where to start this way? i mean what should i use?
2- Should i make my app load the image by reference from my phone, with this i could delete the file from outside the app and loss the image. how should i do this if this is the right way to do it?
3 I would use RoomDatabase for saving the coments for each image, but what library should i use for saving the images?

Thank you very much, i only need guidelines i don't need code snippets, im just starting.
 
You could use image metadata to to do this, with Exif tags. An example of how to do this is shown here

http://android-er.blogspot.com/2009/12/read-exif-information-in-jpeg-file.html

Suggest using the TAG_IMAGE_DESCRIPTION tag to store your comment.


Code:
package com.exercise.AndroidExif;

import java.io.IOException;

import android.app.Activity;
import android.media.ExifInterface;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

public class AndroidExif extends Activity {

TextView myTextView;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        myTextView = (TextView)findViewById(R.id.textview);
        
        //change with the filename & location of your photo file
        String filename = "/sdcard/DSC_3509.JPG";
        try {
   ExifInterface exif = new ExifInterface(filename);
   ShowExif(exif);
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
   Toast.makeText(this, "Error!", 
     Toast.LENGTH_LONG).show();
  }
    }
    
    private void ShowExif(ExifInterface exif)
    {
     String myAttribute="Exif information ---\n";
     myAttribute += getTagString(ExifInterface.TAG_IMAGE_DESCRIPTION, exif);
     myTextView.setText(myAttribute);
    }
    
    private String getTagString(String tag, ExifInterface exif)
    {
     return(tag + " : " + exif.getAttribute(tag) + "\n");
    }
}
 
Back
Top Bottom