Skip to content

ANDLABS-Git/studio-lounge-droid

Repository files navigation

* hAppy Log *

Multi Platform Multi-Player Multi-App

Studio-Lounge Android-Library

###This is a open experimental project to prototype the LOUNGE Framework. The concepting phase is over and we will release a first beta client here soon. So stay tuned.

http://andlabs.eu

Licensed under the Apache License, Version 2.0

API docs

Usage

  • include StudioLounge as Android Library Project

  • register GCP background Service and LoungActivity in AndroidManifest.xml

  <activity android:name="eu.andlabs.studiolounge.LoungeActivity" />
  <service android:name="eu.andlabs.studiolounge.gcp.GCPService" />

Themes can be applied to the Lounge Activity

  • launch the Lounge Activity to visit the Player Lobby and Chat
  startActivity(new Intent(this, LoungeActivity.class));
  • add category "eu.andlabs.lounge" to the Game Intent Filter
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="eu.andlabs.lounge" />
  </intent-filter>

This activity will be started once players joined for a game

  • add the permission
  <uses-permission android:name="android.permission.GET_ACCOUNTS"/>

for authentication and

  <uses-permission android:name="android.permission.INTERNET"/>

for internet access.

  • start, bind and unbind the GCP backround service
  @Override
  protected void onStart() { mLounge = GCPService.bind(this); }

  @Override
  protected void onStop() { GCPService.unbind(this, mLounge); }
  • send game messages
  Bundle data = new Bundle();
  data.putString("foo", "bar");
  mLounge.sendGameMessage(data)
  • receive game messages
  mLounge.register(new GameMsgListener() {                
    @Override
    public void onMessageRecieved(Bundle msg) {
      msg.getString("foo") // returns "bar"
    }
  });

Currently only String data is supported

  • register listeners to implement a custom Lounge experience
  mLounge.register( new LobbyListener() {...} );
  mLounge.register( new ChatListener() {...} );

Sample Game

Moving Points