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 

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!


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. Spin lock lockup issue while disconnecting the data call


I am working on donut/2.6.29 kernel release and getting the following
crash while disconnecting the data call.

<6>[  253.744488] rmnet_stop()
<0>[  262.856377] BUG: spinlock lockup on CPU#0, er.ServerThread/1006,
<4>[  262.856443] [<c003015c>] (dump_stack+0x0/0x14) from [<c017f1ec>]
<4>[  262.856605] [<c017f0f8>] (_raw_spin_lock+0x0/0x130) from
[<c0302874>] (_spin_lock_bh+0x54/0x5c)
<4>[  262.856742] [<c0302820>] (_spin_lock_bh+0x0/0x5c) from
[<c029dda8>] (inet_unhash+0x68/0xac)
<4>[  262.856872]  r5:cc9f7b04 r4:cbb9e5c0
<4>[  262.856935] [<c029dd40>] (inet_unhash+0x0/0xac) from
[<c02a0c60>] (tcp_set_state+0xe8/0x170)
<4>[  262.857063]  r5:cbb9e5c0 r4:cbcf0000
<4>[  262.857125] [<c02a0b78>] (tcp_set_state+0x0/0x170) from
[<c02a0d34>] (tcp_done+0x4c/0x8c)
<4>[  262.857247]  r7:c08ffb04 r6:000006f7 r5:cbb9e5c8 r4:cbb9e5c0
<4>[  262.857350] [<c02a0ce8>] (tcp_done+0x0/0x8c) from [<c02b2344>]
<4>[  262.857472]  r4:cbb9e5c0
<4>[  262.857513] [<c02b22b8>] (tcp_v4_nuke_addr+0x0/0xd0) from
[<c02be234>] (devinet_ioctl+0x6d8/0x788)
<4>[  262.857655] [<c02bdb5c>] (devinet_ioctl+0x0/0x788) from
[<c02becb0>] (inet_ioctl+0xcc/0xfc)
<4>[  262.857782] [<c02bebe4>] (inet_ioctl+0x0/0xfc) from [<c026e2fc>]
<4>[  262.857935] [<c026e114>] (sock_ioctl+0x0/0x248) from
[<c00e1800>] (vfs_ioctl+0x38/0x98)
<4>[  262.858075]  r6:45583d4c r5:00008939 r4:c91f8c80
<4>[  262.858158] [<c00e17c8>] (vfs_ioctl+0x0/0x98) from [<c00e1e6c>]
<4>[  262.858283]  r6:45583d4c r5:cc247120 r4:c91f8c80
<4>[  262.858368] [<c00e1958>] (do_vfs_ioctl+0x0/0x568) from
[<c00e1f00>] (sys_ioctl+0x40/0x64)
<4>[  262.858492]  r9:cbcf0000 r8:c002bfa8 r7:c91f8c80 r6:00008939
<4>[  262.858607] r4:00000045
<4>[  262.858650] [<c00e1ec0>] (sys_ioctl+0x0/0x64) from [<c002be00>]
<4>[  262.858773]  r7:00000036 r6:45583d4c r5:45583d5c r4:adb040c8

Following is my analysis :-

While disabling the data call, android frameworks calls the function
ifc_reset_connections() i.e SIOCKILLADDR ioctl.
The crash occurs while processing the SIOCKILLADDR ioctl in kernel
because it tries to take the same lock two times without releasing the
earlier, one at tcp_v4_nuke_addr() and second at inet_unhash()
function (when sk_state != TCP_LISTEN). This seems to be spin lock
recursion problem.

There are changes done in the locking mechanism as part of the 2.6.29.
earlier it used to take the read/write lock in 2.6.27 but those are
replaced by spin locks in 2.6.29.
tcp_v4_nuke_addr() function in the kernel/net/ipv4/tcp_ipv4.c
inet_unhash function in the kernel/net/ipv4/inet_hashtables.c

I have printed the lock address at both of the above function.

<6>[   92.246526] rmnet_stop()
<0>[   92.301602] ----- in tcp_v4_nuke_addr, lock=CBE12658
<0>[   92.301602] ----- in inet_unhash, lock=CBE12658

It seems to be bug in the 2.6.29 kernel implementation of SIOCKILLADDR
ioctl. Does someone aware of this issue?



2. USB composite gadget

Hi everyone,

 I have one query.

 Is there any plan to support GadgetFS together with Android Gadget in
Android kernel for the "Android Dev Phone"?
 My requirement is to be able to use GadgetFS together with ADB.
 I understand from some previous posts that currently only one driver
is supported, either Android gadget or GadgetFS, but not
 Is anyone from the community or Android team working on enabling
simultaneous support in future version of SDK?

thanks and regards,


3. /etc/mtab equivalent

4. How to make color or highlight the selected row in "Expandable List Activity"?

5. signal when image is rendered?

6. How calculates memory usage of application

7. Issues with this group