-
Notifications
You must be signed in to change notification settings - Fork 1
Setup
There are two ways to set up a project. Clone another similar project an throw out everything you do not need. Setup a clean empty project and add what you need. Both way have their pros and cons.
Throwing out code can be boring and it tends to be a bit weird. You are going to deal with code for which you do not have any interest. It is like tidy up a cellar room. But it works.
You will not miss any detail when starting from the scratch. Your write (or copy) the manifest, copy (and understand) each line of code e.g. to get a reference to a SharkPeer. It takes usually a bit more time but you will be more familiar with the system afterwards.
Either way leads to a running GUI for your application anyway. You choose.
Our main objective was implementing a developer framework but no application. We needed an application as a beacon. We needed a non trivial application that leverages all features of our developer framework. This application helped to shape the API. This application is not meant to be good looking (it is definitely not) or even fully tested (it is not). It proofs to things: 1. Our developer framework works. 2. We can implement an application with it.
That application is SharkNet2Android.
Here are the steps:
- Clone it.
- Remove all unit tests and Android tests (if there are any). You can write your own.
- Remove all src packages but sharknet/android.
- Remove settings subpackage.
- Remove all resource like layouts, menues, string etc.. You do not remove the folder but the resource files only.
- Add (if not already present) the latest release of the following jars to your project:
- Add (if not already present) ASAPAndroid as android component to your project. Have a look at AndroidService build.gradle and settings.gradle
- Remove all activity descriptions but InitialActivity from manifest file.
- Try to build the systems. Throw out what makes problems. Repeat ths step until your project can be build. (It is like tidy up a messy room.)
A little movie gives an overview what you had to do to use ASAP - and what you would gain in return (German / English).
This library is the Android platform support of ASAPJava. The general concept of implementing a ASAP app also applies to Android.
Android specifics are explained in this developers guide.
If you like, have a look in our more complex ASAP based messenger SharkNet2 (which is and probably will always be work in progress).
This movie shows how to set up Android Studio to become ready for a new ASAP. application.
Very important: permissions. Please, add permission in your manifest file, e.g. like this
<!-- ASAPEngine needs to write in files -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- ASAP requires networks access ->
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- if you plan to use Wifi direct -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<!-- if you plan to use Bluetooth -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />