Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UI modification of individual application (Phone,Contacts) in ICS AOSP

I have already successfully modified few applications (Launcher,SMS,Gallery,Email,Calendar) of AOSP but I am facing problems to modify Phone,Contacts applications.

I have gone through the following steps to modify Launcher,SMS,Gallery,Email,Calendar applications:

  1. I have downloaded ICS AOSP and imported individual application in eclipse.
  2. I have changed the package names.i.e. com.android.launcher2 to com.test.launcher2
  3. After Step 1 and Step 2,I was facing errors in individual application because of missing framework classes.I have solved them by importing those missing classes in my application.
  4. I have modify UI of the my application.
  5. I have run the application on emulator.and it's working fine.

Now, I am facing problem while modifying Contacts,Phone applications inside Step 3:

-> When I import missing framework classes of java.* or javax.* in my application,the Console informs me by the error like Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library.

-> To overcome the issues,I tried to include few jar libraries which were specified in Android.mk file and were generated while building downloaded AOSP (ICS).but it didn't solve my issue.

-> I guess com.android.phone.common jar file may solve the issue but I am not able to solve it as I suspect the classes are missing in that file which I got from build.So I am trying to find it on internet since few days,but I couldn't find it.so if anybody have the full(working) version of this jar file,please share it.

NOTE: My development machine has Windows 7.and my short term goal is to modify UI of the Contact,Phone applications and run it .

EDIT: Screenshots of Buildpath enter image description hereenter image description here

EDIT After putting TimSort.java in default package,

enter image description here

I have described this step at github demo also by saying "when I import TimSort.java ,it tries to access some hidden method of Arrays.java class,So I need to import that class".this error is the reason why i created java.util package to include Arrays.java class.otherwise I am happy with importing just TimSort.java.by the way,in screenshot we can see the comment which says something specially about next 2 methods

like image 456
Mehul Joisar Avatar asked Apr 22 '13 08:04

Mehul Joisar


1 Answers

As I said in the last comment, the main problem is you include the java.* and javax.*, which already exists in android.jar. So the builder thought you are building the core library while you are not.

I simply delete the java.util.* package in your project. And no errors. The android.jar has already included many packages including java.xxx and javax.xxx. If there really is a missing java core library you need to use, try refactoring.

Eclipse Snapshot

I checked the Android source, the dx will check the name of your source first by calling:

private static void checkClassName(String name) {
    boolean bogus = false;

    if (name.startsWith("java/")) {
        bogus = true;
    } else if (name.startsWith("javax/")) {
        int slashAt = name.indexOf('/', 6);
        if (slashAt == -1) {
            // Top-level javax classes are verboten.
            bogus = true;
        } else {
            String pkg = name.substring(6, slashAt);
            bogus = (Arrays.binarySearch(JAVAX_CORE, pkg) >= 0);
        }
    }

    if (! bogus) {
        return;
    }

    /*
     * The user is probably trying to include an entire desktop
     * core library in a misguided attempt to get their application
     * working. Try to help them understand what's happening.
     */

    DxConsole.err.println("\ntrouble processing \"" + name + "\":\n\n" +
            IN_RE_CORE_CLASSES);
    errors++;
    throw new StopProcessing();
}

The IN_RE_CORE_CLASSES is the error string you see in the console. That explains why it shows that error.

UPDATE:

Screenshot after adding TimSort.java.

Screenshot after adding TimSort.java

like image 152
StarPinkER Avatar answered Oct 18 '22 00:10

StarPinkER