ViewServer

General

Category
Free
Tag
Tools
License
N/A
Registered
Aug 18, 2014
Favorites
1
Link
https://github.com/romainguy/ViewServer
See also
Android Conductor Generator
KeepActivitiesTile
FSquaDRA
androidtool-mac
ios2android

Additional

Language
Java
Version
N/A
Created
Jul 7, 2011
Updated
Apr 29, 2021 (Retired)
Owner
Romain Guy (romainguy)
Contributors
Romain Guy (romainguy)
Eric Burke (eburke)
Dallas Gutauckis (dallasgutauckis)
13leaf
py - Pierre Yves Ricau (pyricau)
Jake Wharton (JakeWharton)
Jim Baca (desertjim)
Peter Fortuin (peterfortuin)
8
Activity
Badge
Generate
Download
Source code

Advertisement

NOTE: This library is not necessary anymore. Newer versions of Android provide a new tool called Layout Inspector that should be used instead.

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.