Skip to content
Local server for Android's HierarchyViewer
Branch: master
Clone or download
Latest commit 017c01c Feb 2, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper Support for Android 1.0 Dec 8, 2014
viewserver-sample Support for Android 1.0 Dec 8, 2014
viewserver
.gitignore
README.md Update README.md Jan 31, 2016
build.gradle Support for Android 1.0 Dec 8, 2014
gradlew Convert project structure to Gradle. Sep 11, 2013
gradlew.bat Convert project structure to Gradle. Sep 11, 2013
settings.gradle Convert project structure to Gradle. Sep 11, 2013

README.md

ViewServer is a simple class you can use in your Android application to use the HierarchyViewer inspection tool.

ViewServer requires the Android SDK r12 or higher. http://developer.android.com/sdk/index.html

Quick Start

If you do need this library then follow these directions:

  • Include the ViewServer library(easy directions found here)
  • Your application must require the INTERNET permission
  • The recommended way to use this API is to register activities when they are created, and to unregister them when they get destroyed:
public class MyActivity extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Set content view, etc.
        ViewServer.get(this).addWindow(this);
    }

    public void onDestroy() {
        super.onDestroy();
        ViewServer.get(this).removeWindow(this);
    }

    public void onResume() {
        super.onResume();
        ViewServer.get(this).setFocusedWindow(this);
    }
}

Please refer to the documentation in ViewServer.java for more info.

You can’t perform that action at this time.