Unfortunately, it sounds that your teacher just read a few pages and asked you to do something which shouldn't be allowed; it's dumb in the sense that Android development practices work against sharing information like this, and the preferred way would be to either bind to a service offering some bit of communication (when you need to do ipc-ish things) or simply use a content provider, which I think is the use case here. It seems otherwise that your teacher said: make it do this, and you have to make a nasty system hack.
And in the wide majority of cases, if you're developing two "apps" you're going off in the wrong direction. I suspect that this assignment stemmed from someone trying to shoehorn a UNIX mentality onto the Android system..., for example, these types of assignments are typical of old world unix ipc relics that have been superseded by modern APIs -- In Android's case the contentprovider interface.. kris On Thu, Jan 19, 2012 at 6:00 PM, Chihwah <[email protected]> wrote: > > Hello A. Elk, > > Yes, I am doing MPNA "make an high performance networking application" > During the course we learned about C programming, threading, networking, etc > My teacher himself read about Android and it's possibility to share data > between two apps and gave us the assignment to find out about having the > same UID and be able to communicate. > After searching for weeks, I know that android security is not fond of such > practices, Android has a few ways to communicate, for example content > manager. > > We have have made a server / client app using sockets in C, because that was > the easiest and most straightforward way we knew. But even then I like to > know how to share data using the same UID. > Just to show our teacher "found it!" Althought the assignment was not clear > or good enough we tried our best. > > Would be great if someone could tell about sharing with UID, even thought it > will not influence our assigment results any longer. If you or someone else > knows, do send an e-mail. So that we might close the "quest" with good > content.... > > Kindest regards, > > Cw > > > Op 19-1-2012 23:18, A. Elk schreef: > >> Are you sure that this is the assignment? >> >> You can force two applications to have the same UID by using an attribute >> of the <manifest> element in AndroidManifest.xml. This is documented in >> Security and Permissions, >> http://developer.android.com/guide/topics/security/security.html. This guide >> also describes the ramifications of sharing a UID. Once you do this, the two >> application are treated as "one" by Android, so they share the same >> "sandbox". This means that a file written by one can be read by another. To >> share a variable, you could create an object and then serialize it to a >> file. >> >> However, I strongly recommend against doing this sort of thing. It's not >> the way Android is designed to work. Applications should avoid knowing too >> much about one another. An application A should use common APIs to send >> information to an application B, with the assumption that B could be >> anything. >> >> In summary, I think it's a bad assignment. >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

