How to design a light and a full version of android app.

by Anton Pirker » Thu, 03 Sep 2009 17:35:46 GMT


Sponsored Links
 Hello Androids!


I have done a small app for the ADC2 and now i want to make a free light 
version for the Android market and one full version that will cost some 
cents.

My question now to all who have done something similar: How have you 
designed your application(s)?
I have thought about a few solutions to this problem:

1.) Duplicate the code in two different android projects
Not a very good idea, duplicate code is always bad.

2.) Create some sort of library to use in two different projects.
With this i could share the business logic of my app, but not the 
activities (at least this is what i think)
And using the activities from one project in another project would be great.

3.) Include all needed code (business logic, activities, ...) from one 
project (the full version) in my light version.
This way i would achieve some sort of new "view" to the code basis. This 
would be the best solution i think, but i do not know how to achieve this.

So to everybody who has done a full and light version of one and the 
same app: How have you done this?

In advance: Thanks for sharing!
Anton


--~--~---------~--~----~------------~-------~--~----~



How to design a light and a full version of android app.

by Chris Stratton » Thu, 03 Sep 2009 21:25:27 GMT


 I would recommend one shared code base, and some means of compiling it
in two different versions.  This will be important because you only
want to fix bugs once...

Not sure if eclipse or ant can handle this (probably somehow) but
there's always resort to recursive cp, find, and sed...   The latter
may be particularly useful if you want to do a global rename so that
it's technically possible to have full and light versions installed on
the same phone without conflict (being able to upgrade from light to
full and preserve user data might point in the other direction, at
least if the market will let you have to different apps with the same
package names)




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Prefix in devices.c

Hello,

can somebody explain me for what the variable: "prefix" in the
following struct is used for:

Android-sources/system/init/devices.c
...
struct perms_ {
    char *name;
    mode_t perm;
    unsigned int uid;
    unsigned int gid;
    unsigned short prefix;
};
...

Obviously, it can have the values € or 1.


Greetz
Dudero

-- 

2. java.io.EOFException

my write code
    public static void writeFBTagToCache(long crc64) {
        try {


            ArrayList<tagStruct> tags = mItem.getTags();

            if(tags == null || tags.size() <= 0) {
                Log.d(TAG, "tags is null + " + mItem.mGuid);
                return;
            }

            int size = tags.size();
            File tempFile = null;
            final String tempFilePath = FB_TAG_CACHE;
            String prefix = crc64 + "";
            tempFile = File.createTempFile(prefix, ".cache", new
File(tempFilePath));
            final FileOutputStream fileOutput = new FileOutputStream(tempFile);
            final BufferedOutputStream bufferedOutput = new
BufferedOutputStream(fileOutput, 1024);
            final DataOutputStream dataOutput = new
DataOutputStream(bufferedOutput);

            try {
                for(int i = 0; i < size; i++) {
                    tagStruct tag = tags.get(i);
                    dataOutput.writeInt(size);
                    dataOutput.writeFloat(tag.mXcoord);
                    dataOutput.writeFloat(tag.mYcoord);
                    Utils.writeUTF(dataOutput, tag.mTag);
                }

                if(dataOutput != null) {
                    dataOutput.close();
                    bufferedOutput.close();
                    fileOutput.close();
                }
            } catch (Exception e) {
                // Was unable to perform the operation, we delete the temp file
                Log.e(TAG, "Unable to write the index file " + crc64);
                tempFile.delete();
            }
        }catch(IOException e) {
            e.printStackTrace();
        }
    }

-------------------------------------------------------------------------------------------------
my read code
    public static ArrayList<tagStruct> createFBTagFromCache(long crc64) {
        Log.e("harvey", "create facebook tag from cache");
        try {
            File tempFile = null;
            final String tempFilePath = FB_TAG_CACHE;
            String prefix = crc64 + "";
            tempFile = File.createTempFile(prefix, ".cache", new
File(tempFilePath));

            FileInputStream fileInput = new FileInputStream(tempFile);
            BufferedInputStream buf = new BufferedInputStream(fileInput);
            final DataInputStream dataInput = new DataInputStream(buf);

            try {
                int size = dataInput.readInt();
                ArrayList<tagStruct> tags = new ArrayList<tagStruct>(size);
                for(int i = 0; i < size; i++) {
                    tagStruct tag = new tagStruct();
                    if(i!=0) {
                        int laji = dataInput.readInt();
                    }
                    tag.mXcoord = dataInput.readFloat();
                    tag.mYcoord = dataInput.readFloat();
                    tag.mTag = dataInput.readUTF();
                    tags.add(tag);
                }
                dataInput.close();
                return tags;
            } catch (Exception e) {
                dataInput.close();
                return null;
            }
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
---------------------------------------------------------------------------------------------
Exceptoin cause following:

05-05 13:32:50.058: WARN/System.err(5268): java.io.EOFException
05-05 13:32:50.058: WARN/System.err(5268):     at
java.io.DataInputStream.readInt(DataInputStream.java:287)
05-05 13:32:50.058: WARN/System.err(5268):     at
com.cooliris.media.UriTexture.createFrTagFromCache(UriTexture.java:455)
05-05 13:32:50.058: WARN/System.err(5268):     at
com.cooliris.media.UriTexture.createFromUri(UriTexture.java:185)
05-05 13:32:50.058: WARN/System.err(5268):     at
com.cooliris.media.UriTexture.load(UriTexture.java:362)
05-05 13:32:50.058: WARN/System.err(5268):     at
com.cooliris.media.RenderView.loadTextureAsync(RenderView.java:308)
05-05 13:32:50.058: WARN/System.err(5268):     at
com.cooliris.media.RenderView.access$6(RenderView.java:306)
05-05 13:32:50.058: WARN/System.err(5268):     at
com.cooliris.media.RenderView$TextureLoadThread.load(RenderView.java:1176)
05-05 13:32:50.058: WARN/System.err(5268):     at
com.cooliris.media.RenderView$TextureLoadThread.run(RenderView.java:1160)
05-05 13:32:50.259: WARN/System.err(5268): java.io.EOFException
05-05 13:32:50.259: WARN/System.err(5268):     at
java.io.DataInputStream.readInt(DataInputStream.java:287)
05-05 13:32:50.259: WARN/System.err(5268):     at
com.cooliris.media.UriTexture.createFrTagFromCache(UriTexture.java:455)
05-05 13:32:50.259: WARN/System.err(5268):     at
com.cooliris.media.UriTexture.getTag(UriTexture.java:689)
05-05 13:32:50.259: WARN/System.err(5268):     at
com.cooliris.media.RenderView.drawTag(RenderView.java:251)
05-05 13:32:50.259: WARN/System.err(5268):     at
com.cooliris.media.RenderView.uploadTexture(RenderView.java:613)
05-05 13:32:50.259: WARN/System.err(5268):     at
com.cooliris.media.RenderView.processTextures(RenderView.java:580)
05-05 13:32:50.259: WARN/System.err(5268):     at
com.cooliris.media.RenderView.onDrawFrame(RenderView.java:755)
05-05 13:32:50.259: WARN/System.err(5268):     at
android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
05-05 13:32:50.259: WARN/System.err(5268):     at
android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)

-------------------------------------------------------------------------
why??

-- 

3. Tanya : app android di playbook.

4. Basic Concept

5. Request to join Android Developers

6. Does not work on I1

7. Hello, Android troubles