Modify the source code of contacts application on an Android - android

I want to know if it's possible to customize the default contact application because I want to write a better one. One that gives a ranking of the contacts in a particular user context (based on location, time, day, recent calls...). I want to give a list of 10 contacts which will probably be called. I've read that some internal classes in the application are not public and not in the SDK API's. So is there another way? I also started to write my own application and it's easy to get the contacts and make the design. But is it possible to make calls in it?
Thx in advance!

Yes, technically it is possible to modify the Contacts application, but it requires you to download the source. All of the source to the original Contacts application is on the documentation web site. Download the source, find the application and modify what you desire to modify. To address your issue about some of the class not being public, I'm sure you can figure it out. I can't imagine the functionality from those classes would be too hard to reproduce (unless they are core classes).

Related

How to get a list of locally stored phone contacts with App Inventor 2?

So wasn't sure how to title this one but I'm hoping someone with Android experience can answer this for me.
I'm trying to turn Android code into App Inventor 2 code. I need to start a new activity and have the relevant Action, ActivityPackage, ActivityClass, DataType, ExtraKey, ExtraValue (whether all of these are needed for this specific situation I'm not sure) to input into an ActivityStarter that views the locally stored phone contacts.
I am sure there is a way, there is in just Android app making with Java but I need help translating that code across. I'm pretty sure I want an android.intent.action.VIEW and contactsContract.CommonDataKindsPhone I'm just not sure in which parts in should go and what else I need to than be able to add that information to a list.
This is what I have so far:
I'm sure others would appreciate this information, as well as how to get other related data to contacts into App Inventor 2.
Also I know about ContactPicker.PhoneNumberList and PhoneNumberPicker.PhoneNumberList neither of which are able to find any contacts on my phone which is why I'm trying to work out a work-around.
Anyway any help is appreciated,
Thanks.
Unfortunately it's not possible to get a list of locally stored phone contacts with App Inventor. See also issue 734 in the Issues List. I suggest you to star this issue, so probably one day we get this feature into App Inventor.
The ContactPicker.PhoneNumberList or PhoneNumberPicker.PhoneNumberList only give you all phone numbers of a contact after picking a contact.
App Inventor has its limitations and unfortunately you can't do something like this as described in this Stackoverflow answer. The only thing you can do is to access the Google Contacts API with the web component to get a list of contacts, but precondition is, your contacts are synchronized with Google, but this is not what you want. An example to do that you can find here.

Best way to display credits from an android application

GOAL
Hi, I plan to include in all my aps a "credits" button that will display my logo, URL, etc.
PREFERRED SOLUTION
In order to be more effective I would like to have it as an independent app, so that if I later modify it, all the apps calling it would get updated to the same credits display, instead of modifying each of them.
ALTERNATIVES
*(a)* Of course the easy solution is to copy it within each of my apps and update manually each of them. I think this is not so effective when the number grows.
(b) Having a kind of external resource like a mobile adapted webpage which would always be called. I would only need to change it. But I open then the workfield out of android.
My first idea is to have to define it as an independent activity and get it called from each of the apps.
I have two related questions:
1. How do I ensure this "credits" activity gets installed with an application (is there a kind of dependency which can be defined?)
2. Is this a reasonable way of doing it within Android context?
Thanks.
PREFERRED SOLUTION In order to be more effective I would like to have it as an independent app, so that if I later modify it, all the apps calling it would get updated to the same credits display, instead of modifying each of them.
No user will download this, so do not bother writing it.
How do I ensure this "credits" activity gets installed with an application (is there a kind of dependency which can be defined?)
There is no way to accomplish this.
Is this a reasonable way of doing it within Android context?
No. As #bigstones suggests, use an Android library project.

Whats the best solution for a database used in conjunction with Maps in Android?

Could someone please point me in the right direction. My project involves a database where users enter their address and other info from my website. This database is then referenced in my android application to show the locations of these addresses in my database.
I have yet to start and just came up with this idea. My question is, what would be the best method to create a database easily modified through my website (mySQL, php, etc), and also easily referenced easily through Android and the Google Maps API? I need some ideas on the languages I will need to use to create this database and website so I can go buy the necessary books to start reading up.
Thanks so much
I believe the best way for you to go with this one is:
a database cache on the device
that means you can use XML if you don't have many complicated requirements from storing the address
or SQLite if you want to be able to query the database and do more fancy things
on the server side
if you only need to get the data from your server on the device, then a simple XML with a unique address per user should do it
if you need to push addresses from your device to the server then a REST system needs to be implemented
So, now you just need to figure out exactly what you need from your system and then start googleing on one of the solutions I gave you! Good luck! :)
Google App Engine would probably work for that. GAE supports Java and Python. Maybe use the Restlet framework (compatible with GAE) to implement a REST architecture.

How does sharing application components happen in android?

it's been some time now, since I started reading about android.
I've already made a few basic applications, but I still miss something: How is actually sharing application component being done?
This is what the Android Dev Guide says:
A central feature of Android is that one application can make use of elements of other applications (provided those applications permit it). For example, if your application needs to display a scrolling list of images and another application has developed a suitable scroller and made it available to others, you can call upon that scroller to do the work, rather than develop your own. Your application doesn't incorporate the code of the other application or link to it. Rather, it simply starts up that piece of the other application when the need arises.
I think I came across some question like this, but I think I'm still confused.
Is the only way of getting such a 'private application' information to contact the developers of that application?
Is information about the data that the application operates with private, too?
If it is described in the AndroidManifest.xml file is it available for the other applications, or it is available only to Android?
When I started satisfying my interest in Android - one of the things that grabbed me was the impression of immense interoperability...
:)
Have I been wrong or I still haven't found the way?
Thanks!
How is actually sharing application component being done?
That depends entirely on what you consider an "application component" to be, and what you consider "sharing" to be.
This is what the Android Dev Guide says
That is a fairly bad piece of the documentation. Here is how I would write it:
A central feature of Android is that one application can make use of components (e.g., activities, services) of other applications (provided those applications permit it). For example, if your application needs to display a list of contacts and another application has developed an activity that does just that and made it available to others, you can call upon that activity to do the work, rather than develop your own. Your application doesn't incorporate the code of the other application. Rather, it simply starts up that piece of the other application when the need arises.
Is the only way of getting such a 'private application' information to contact the developers of that application?
Either developers are intending for you to integrate with them, or they are not. If they are, they should be documenting how to do that (e.g., Intent formats to be used with startActivity() to trigger their code). If they do not document such integration points, you can certainly ask the developers to add some. However, randomly shooting Intents at them in hopes of getting a response, even if it temporarily works, is little better than script kiddie tactics -- those developers are not obligated to ensure you code works when they upgrade their app.
Is information about the data that the application operates with private, too?
I do not know what "information about the data that the application operates with" means. Data managed by an application is private by default. Again, application developers can offer integration points for data (e.g., content provider, remote service API) -- some do, some do not.
one of the things that grabbed me was the impression of immense interoperability
Android offers greater interoperability potential than some other mobile platforms. However, using that potential requires consent among the interoper-ees. You cannot unilaterally decide to hack into another app's database, or invoke private activities, just because you feel like it.
Should more Android developers offer more integration points? In the abstract, sure. However, bear in mind that this adds support costs (e.g., answering integration questions) and limits coding flexibility (e.g., need to maintain a stable API for those doing the integrating). Developers cannot be blamed if they do not wish to incur all that.

How do I replicate the functionality of selecting contacts in messaging app?

Android's messaging app, located in projects/platform/packages/apps/Mms.git has a class called RecipientsEditor. I would like to be able to create MultiAutoCompleteTextView that will filter contacts the same way, to make contact selection easy in my app. using the mms app is cumbersome since it uses internal apis and has everything split across classes.
Has anyone made an easy way to do this?
It's a bad idea for public applications but you can use code and resources from other applications if you have the right class loader. I wrote about it, using createPackageContext and some reflection.

Categories

Resources