I was wondering if there is a way to reuse my classes in Android projects where the only thing that changes is the R import?
So for example I have one file saved where the import is :
import com.myname.project.R
And in my second project the class is exactly the same as the one in the first project except it’s import for the R file is different:
import com.myname.projecttwo.R
This means I have to maintain two files with just the import being different, son when I change something in one I have to remember to change it in the other.
Is there a standard way to avoid this and have only one file where I can change whatever I want and I will be able to use it in both projects?
If you want to use a lot of shared code, you probably should be using a library project to keep your codebase and then two different projects with your resources.
Android Developer explains it nicely, see: http://developer.android.com/guide/developing/projects/index.html#LibraryProjects.