Giter Club home page Giter Club logo

template-android's Introduction

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 required

In app/src/main/res/values/strings.xml:

  • Set the application name

In app/src/main/java/com/APPNAME/application/SplashActivity.java:

  • Set the next activity after the Splash screen

Replace 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 one

In app/src/main/java/com/APPNAME/application/MapsActivity.java:

  • Modify the Google Maps start location and zoom

In 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 fonts

In app/src/main/res/values/styles.xml:

  • Configure PrimaryFont and PrimaryFontBold to use the new fonts

In 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 executed

Start the service in an Activity:

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.

Google Maps API Key (for development builds)

Generate a Google Maps SDK API key (step 1).

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:

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.

template-android's People

Contributors

jleung51 avatar renovate-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.