parse-android-test-app
Test Android application for Parse test server.
1. Information
1.1. Features
Fully working communication with Parse test server:
- managing simple entity (Note);
- sync data with server;
- restore data from server;
- sign up from application with email address or Facebook account;
- sign in to server with email or Facebook.
1.2. Not handling exceptions
- Internet connection unavailable status;
- Parse Server connection unavailable status.
2. Parse initialization
2.1. Application class
2.2. ParseApi class
2.3. Requiring parameters
Name | Description |
---|---|
SERVER_ADDRESS | Address of Parse server in your network |
APP_ID | Parse server app id |
CLIENT_KEY | Parse server client key |
2.4. Parse API
Parse API provided methods for managing entities in app.
2.4.1. Save all notes
Argument | Type | Description |
---|---|---|
notes | List<Note> |
Notes to save |
errorOnSave | Function |
Error callback |
2.4.2. Restore all notes
Argument | Type | Description |
---|---|---|
notes | List<Note> |
Notes in local database |
afterRestore | Function |
Restore callback |
2.5. Parse Auth API
Parse Auth API provides methods for authorization with email or Facebook account.
2.5.1. Authorization check
2.5.2. Register with email
Argument | Type | Description |
---|---|---|
username | String |
Name |
String |
||
password | String |
Password |
afterLogin | Function |
Login callback |
2.5.3. Log in with email
Argument | Type | Description |
---|---|---|
String |
||
password | String |
Password |
afterLogin | Function |
Login callback |
2.5.4. Log in with Facebook
2.5.4.1. Log in method
Argument | Type | Description |
---|---|---|
fragment | Fragment |
Fragment (can be replaced to Activity) for user data request |
afterFacebookLogin | Function |
Login callback |
2.5.4.1. Handling onActivityResult
Argument | Type | Description |
---|---|---|
requestCode | Int |
requestCode from request |
resultCode | Int |
resultCode from request |
data | Intent |
data from request |
2.5.5. Logout
Argument | Type | Description |
---|---|---|
afterLogout | Function |
Logout callback |
3. Database
ORMLite. More on official site.
4. Data structure
This section contains full list of entities using in app.
4.1. Entity
Base class for all database entities.
4.2. Note
4.2.1. Save note
From Note class method:
Example:
4.2.2. Delete note
From Note class method:
Example:
4.2.3. Get all notes from database
From Note class method:
Example:
4.2.4. Delete all notes from database
From Note class method:
Example:
4.2.5. Get ParseObject for note
From Note class method:
Example:
4.2.6. Initialize note from ParseObject
From Note class method:
Example:
5. Facebook install
5.1. Resources
5.2. Usage
In preferences.xml
replace this values to own analogues: