Viewer for Android

SDK Download

Add library to project

With your project open click on File -> New -> New module and select Import .JAR/.AAR Package. In the next screen select the supplied aar file in File name and click Finish.

Right click on the application module and select Open Module Settings. On the tab Dependencies add the imported floorplannerviewer as a Module dependency.

Add viewer to activity

Add the viewer fragment to your layout file.

  android:layout_height="match_parent" />

Get a reference to the viewer and store it in field of your activity.

import com.floorplanner.floorplannerviewer.FPViewerFragment;
// ...
private FPViewerFragment viewerFragment;

protected void onCreate(Bundle savedInstanceState) {
  // ...
  viewerFragment = (FPViewerFragment)getSupportFragmentManager()
  // ...

Use viewer fragment

Load project

Using loadProject you can load a new project using either a project id or an url to a fml project.


Change view mode

Using getViewMode and setViewMode you can change the active viewmode for the viewer.

if (viewerFragment.getViewMode == FPViewerFragment.ViewMode.Mode3D) {
} else {

Get designs in project

The following example lists the available designs in a Menu using getFloors, shows them and selects the new design using loadDesign.

viewerFragment.getFloors(new FPViewerFragment.GetFloorsHandler() {
  public void onReceiveFloors(List<Floor> floors) {
    PopupMenu popup = new PopupMenu(MainActivity.this, control);
    Menu menu = popup.getMenu();

    for (Floor floor : floors) {
      SubMenu subMenu = menu.addSubMenu(floor.getName());

      for (final Design design : floor.getDesigns()) {
        MenuItem menuItem = subMenu.add(design.getName());
        menuItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
          public boolean onMenuItemClick(MenuItem item) {
            return true;