File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes Application is OverWritten Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Mobile » Android
Bookmark "Application is OverWritten" Watch "Application is OverWritten" New topic
Author

Application is OverWritten

Vishal Trivedi
Ranch Hand

Joined: Sep 05, 2011
Posts: 57
Hi

I have recentky started with androids and i came across this problem

The thing is whenever i would create a new project and run it in emulator the earlier Application would be over-written.
On much R&D i found out that this could be case because the package structure that i have given is src folder is same for all the applications that were replaced

Can Anyone help on this!!!
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

For every application give new package name.


Life is easy because we write the source code.....
Vishal Trivedi
Ranch Hand

Joined: Sep 05, 2011
Posts: 57
Yes that is easy ,but was not the type of solution that i was looking for

What i meant was that is there a way to get around it.
That beacause the Emulator or the Android Device the does not resolves the applications by name but rather its package structure.
What if two different application has same package structure the the older one is bound to be replaced.

Hope I am able to convey what i want to...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
Why would two different applications ever have the same package structure?


Ping & DNS - my free Android networking tools app
Vishal Trivedi
Ranch Hand

Joined: Sep 05, 2011
Posts: 57
Yes I understand that two apps cannot have might not have same structure but what i want to know is
why two applications wid just same name of packages but different application.Cannot be on a same device.
Does this imply that Applications are stored in differently.
This also may mean that application may be replaced by newer version of same app that has same structure.

I am just curious why does this happen ....
As in computers dont do these way....


Vishal Trivedi
Ranch Hand

Joined: Sep 05, 2011
Posts: 57
Why would two different applications ever have the same package structure?



As i said earlier I am new with android and while i was practising i just used "com.vishal.android" as default package for all the applications.

And I believ due to this ,they were replaced by the newer app every time i would run one...

I was curious to know that why should any thing lke this happen.Since the files have different application name.

Is This the feature of Android devices that they link intenal structure to install apps or APPLICATION_NAME.apk to store and install
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
Yes, applications are identified by their package names, not by their display names. Note how you uninstall applications using "adb uninstall ..."
Vishal Trivedi
Ranch Hand

Joined: Sep 05, 2011
Posts: 57
Yess. That is right

But I have also seen Eclipse Console showing

Installing AppName.apk...

But thanks for the solution
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
Yes, installs are done by the file name of the apk file, but not uninstalls. This is all described in the JDK docs.
Vishal Trivedi
Ranch Hand

Joined: Sep 05, 2011
Posts: 57
Thank You Very Much....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Application is OverWritten