7

I downloaded the source code of the default Browser application of the android from here

and tried it to build from the eclipse. It is showing various build error in different classes.Main error is due to in import as it is not able to pick the following classes.

import android.provider.BrowserContract;
import android.net.WebAddress;
import android.webkit.WebSettings.AutoFillProfile;

and similarly others.I searched it in the documentation of the package of android.provider of android and no such class is mentioned. Looking for the help

XXX
  • 8,996
  • 7
  • 44
  • 53
Deepak Goel
  • 5,624
  • 6
  • 39
  • 53
  • I have tried the steps provided on this link http://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-1-introduction/ and now it is working fine... – Deepak Goel Sep 24 '13 at 06:24

1 Answers1

8

The default browser is not an "SDK" application. It is not developed with the SDK, but within the whole Android project. It has therefore access to internal class which are not exposed in the SDK.

So you can't build it as a regular app. You will have to build it along the whole Android project, which means download all the Android source code, and do at least one full Android build. And i'm not sure the resultant apk can be installed normally on a device.

Anasthase
  • 491
  • 2
  • 7
  • Thanks for your response.But in Source folder the BrowserContract class is exist but in the android.jar the class file is missing. – Deepak Goel Jan 17 '12 at 14:51
  • Ok i got your point.Actually they used the annotation @hide to hide it from android.jar.So how we can customize the browser app of android. – Deepak Goel Jan 17 '12 at 15:11
  • There is no `BrowserContract` class in the browser code. It is part of `platform_framework_base` (https://github.com/android/platform_frameworks_base/blob/master/core/java/android/provider/BrowserContract.java), and is tagged `@hide`, which means it will not be available in the SDK (and thus won't be in android.jar). What are you trying to do exactly? – Anasthase Jan 17 '12 at 15:16
  • I am just trying to run the default browser application.But facing the problem because of the hidden API of the SDK.Should i add all the relevant class or is their any workaround for the same – Deepak Goel Jan 18 '12 at 03:29
  • Adding relevant class does not seems feasible, as added class will need others class. You will end up adding almost everything. The only thing i see is to remove/re-implement all the things using hidden API. – Anasthase Jan 18 '12 at 08:23
  • now iam trying something like this http://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-1-introduction/ – Deepak Goel Jan 18 '12 at 09:49