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:
com.android.launcher2
to com.test.launcher2
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.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
EDIT After putting TimSort.java in default package,
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
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With