Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jleung51/template-android
Template Android application with support for styling, asynchronous jobs, device service wrapper APIs, location, common screen templates, and more.
https://github.com/jleung51/template-android
android android-application app application mobile
Last synced: 9 days ago
JSON representation
Template Android application with support for styling, asynchronous jobs, device service wrapper APIs, location, common screen templates, and more.
- Host: GitHub
- URL: https://github.com/jleung51/template-android
- Owner: jleung51
- Created: 2020-01-01T11:54:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-30T07:53:12.000Z (over 3 years ago)
- Last Synced: 2024-12-06T23:19:50.729Z (2 months ago)
- Topics: android, android-application, app, application, mobile
- Language: Java
- Homepage:
- Size: 2.41 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Template Android Application
Template Android application.
___
## Template Quickstart
### Application Basics
In `app/app/build.gradle`:
* Update the value `android.defaultConfig.applicationId`In `app/src/main/AndroidManifest.xml`:
* Refactor the package (use Smart Rename)
* Remove permissions which are not requiredIn `app/src/main/res/values/strings.xml`:
* Set the application nameIn `app/src/main/java/com/APPNAME/application/SplashActivity.java`:
* Set the next activity after the Splash screenReplace `app/src/main/res/logo.xml` with your application logo.
Add a new application launcher icon.
### Google Maps
In `app/src/debug/res/values/google_maps_api.xml`:
* Change the Google Maps key to an updated oneIn `app/src/main/java/com/APPNAME/application/MapsActivity.java`:
* Modify the Google Maps start location and zoomIn `app/src/main/res/raw/google_maps_styling.json`:
* Modify the Google Maps styling file as per your preference### Fonts
In `app/src/main/res/font/`:
* Add the `.ttf` files for your preferred fontsIn `app/src/main/res/values/styles.xml`:
* Configure `PrimaryFont` and `PrimaryFontBold` to use the new fontsIn `app/src/main/res/values/colors.xml`:
* Change the colors to the preferred style### NFC Scanner
In `app/src/main/java/com/APPNAME/application/NfcScanActivity.java`:
* Implement an action and error handling upon reading a new NFC tag (see `processError()` and `processData()`)In `app/src/main/res/layout/activity_scan.xml`:
* Customize the layout and content### Nearby Connections
Copy and modify the sample payload callback function in `app/src/main/java/com/APPNAME/application/NearbyConnections.java` to execute an action upon receiving data.
Call the public functions of the class to initialize and advertise/discover other devices.
Add methods to create operations which interact with the other devices.
### Repeating Services
In `app/src/main/java/com/APPNAME/application/RepeatingService.java`:
* Set the interval of recurrence
* Set a task to be repeatedly executedStart the service in an Activity:
```java
startService(new Intent(this, RepeatingService.class));
```### Settings
In `app/src/main/res/xml/root_preferences.xml`:
* Change the preferences to the appropriate values and types
* Access the preferences using the `SettingsManager.java` class___
## Setup
### Android
Install [Android Studio](https://developer.android.com/studio/).
#### Google Maps API Key (for development builds)
Generate a [Google Maps SDK API key (step 1)](https://developers.google.com/maps/documentation/android-sdk/get-api-key).
In the file `app/src/debug/res/values/google_maps_api.xml`, replace the value of the placeholder key with your API key.
Build and run the Android application on a physical or virtual device.
#### Creating a Production Release
##### Step 1: Building a Release Variant
Create a new file in the root directory to hold the secure keystore details:
```shell
cp keystore.properties.template keystore.properties
```This file will be ignored by Git. Set your keystore information in this file.
Under _Build_, click _Select Build Variant_.
In the _Build Variants_ view which appears, change the **Active Build Variant** from _debug_ to _release_.
Build the application normally to your phone. The keystore credentials will be verified and applied.
##### Step 2: Creating the Signed App
Under _Build_, click _Generate Signed Bundle / APK_.
Follow the instructions, inputting your keystore path and credentials, to create a signed app which can be uploaded to the app store.