Android Development: Adding touch support

When creating an App users need to somehow interact with your program. Mostly this will include touch support. To set up touch support you need to do the following¬†Warning lots of code !!¬†I will try to explain everything step by step. Lines 8, 39,73: Listen to the various events. Line 11-28: When a mouse-down event […]

Android development: Loading bitmaps

If you want to add graphics to your application you can use the following information Create a custom Activity like this public class GameActivity extends Activity implements Observer{ private static final String TAG = “StrategoGameActivity”; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.setContentView(new StrategoGameView(this)); ActionBar actionBar = getActionBar(); actionBar.hide(); } @Override public void update(Observable observable, […]

Android Development: Responding to a socket request

Warning: Worst Blog post written ever in history! in my current project, a simple multiplayer game, I need to react on a connection request from another device. Currently both devices start their own service discovery. On one device I go to the list of found services and pick on. On the click the ServiceHelper will […]

Android Development: Starting a server socket

As you already know the application i’m building is using service discovery to connect to other devices. How does this work? Step 0:  Add activity as observer to the servicehelper class (line 4) Step 2: Start registering the service to the network (10) protected void onResume() { Log.d(TAG, “On Resume called”); ServiceHelper.getInstance(this).addObserver(this); if (!ServiceHelper.getInstance(this).hasServiceRegistered( StrategoService.SERVICE_NAME, […]