forked from actorapp/actor-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: add android configuration section
- Loading branch information
Showing
1 changed file
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,52 @@ | ||
# Building Android App | ||
|
||
Building android app is very easy. Just download [Android Studio](http://developer.android.com/sdk/index.html) and import project from [app-android](../../app-android/). | ||
### Requirements | ||
* [Android Studio](http://developer.android.com/sdk/index.html) | ||
|
||
### Development | ||
To change source code of android app import project from [app-android](../../app-android/) in Android Studio. | ||
|
||
### Configuration | ||
Configuration is performed in [actor-bootstrap/app-android/src/main/java/im/actor/enterprise/MessengerApplication.java](../../app-android/src/main/java/im/actor/enterprise/MessengerApplication.java) | ||
|
||
All customizations are inside `onConfigureActorSDK` method, and performed via methods of `ActorSDK.sharedActor()` | ||
|
||
``` | ||
@Override | ||
public void onConfigureActorSDK() { | ||
//customizations goes here | ||
//ActorSDK.sharedActor().set... | ||
} | ||
``` | ||
|
||
List of avaiable customizations: | ||
#### Set server endpoints | ||
In case of self hosted solution, the most important parameter is server endpoints. You can set them like this: | ||
|
||
``` | ||
ActorSDK.sharedActor().setEndpoints(new String[] { | ||
"tcp://93.184.216.34:9070" | ||
}); | ||
``` | ||
Endpoint is: | ||
``` | ||
<schema>://<server address>:<port> | ||
``` | ||
where: | ||
- schema: tcp or tls in case of secured connection | ||
- server address: your server ip/dns | ||
- port: your endpoint port | ||
|
||
#### Change application name | ||
If you want to change application name, you can do it this way: | ||
``` | ||
ActorSDK.sharedActor().setCustomApplicationName("My awesome messenger"); | ||
ActorSDK.sharedActor().setAppName("My awesome messenger"); | ||
``` | ||
|
||
#### Receive push notification without configuring Google push service | ||
Android application can work as background task, receiving push notification, it can replace Google pushes, or coexist with them. | ||
You can enable background service this way: | ||
``` | ||
ActorSDK.sharedActor().setIsKeepAliveEnabled(true); | ||
``` |