Skip to content

Latest commit

 

History

History
236 lines (192 loc) · 8.82 KB

README.md

File metadata and controls

236 lines (192 loc) · 8.82 KB

Android Starter

Android Starter is a module that we use internally in our projects. It takes care of all basic setup and scaffolding needed, as per best practices that we have come across thus far. Simply integrate it into your project and get started!


Included in this module:

  1. Build Helper
  2. Retrofit Builder
  3. API Handler
  4. Base URL Helper
  5. JSON Helper
  6. End-Point Config
  7. Pagination Helper
  8. Logger
  9. Session Handler
  10. Screen Density Conversion Helper
  11. Date Helper
  12. HTML Helper
  13. String Helper
  14. Network Connectivity Helper
  15. ID Generator
  16. Dimension Config.
  17. Widget Style Config.
  18. Misc. Config.
  19. App Compat
  20. Card View
  21. Recycler View
  22. Facebook SDK
  23. Google Auth SDK
  24. Custom Font Config.
  25. ORM

Integration:

  1. Open your Android Studio project.
  2. Select Project Structure from the File menu on Android.enter image description here
  3. Click on the + icon present at the top left corner and select Import Gradle Project before clicking Next.enter image description here
  4. After clicking Next button a new screen appears and asks you to specify the Source directory of your module.
  5. Set the Source directory path of your Gradle project module and change the Module name if required after checking the import checkbox.enter image description here
  6. Click Finish button to proceed and add the Gradle project module and then click OK to see if the module is added in the Project Explorer.
  7. Repeat Step 2.
  8. Select your project app folder and then select the Dependencies tab.
  9. Now, click on the + icon at the bottom of the Dependencies tab and select Module Dependency.enter image description here
  10. A new screen appears to select the module that you have added to your project.
  11. Select the Gradle project module from the list of available module and click on OK button at the bottom right corner.enter image description here
  12. Now, click on the OK button again present at the bottom right corner and now you are done integrating the module as a dependency.

Details:

  1. Build Helper Helper class to initialize the SDK and apply few basic settings like: Enable/Disable debug mode and setting build type to Poduction/Staging.

Utitlity/Helper Class AppHelper.java

  1. Retrofit Builder Instance which uses the interface and the Builder API which allows defining the URL end point for the HTTP operation.

Utitlity/Helper Class AppClient.java

Libraries com.squareup.retrofit2:retrofit:2.2.0 com.squareup.retrofit2:converter-gson:2.2.0 com.squareup.okhttp3:okhttp-urlconnection:3.6.0 com.squareup.okhttp3:logging-interceptor:3.6.0

  1. API Handler Interfaces which defines the possible HTTP operations. Every method of an interface represents one possible API call. It must have a HTTP annotation (GET, POST, etc.) to specify the request type and the relative URL. The return value wraps the response in a Call object with the type of the expected result.

Utitlity/Helper Class API.java

Libraries com.squareup.retrofit2:retrofit:2.2.0 com.squareup.retrofit2:converter-gson:2.2.0 com.squareup.okhttp3:okhttp-urlconnection:3.6.0 com.squareup.okhttp3:logging-interceptor:3.6.0

  1. Base URL Helper Base Url Helper class to get the base url that is set.

Utitlity/Helper Class BaseUrlHelper.java

  1. JSON Helper Utility class to do JSON related conversions.

Utitlity/Helper Class GsonHelper.java

Libraries com.google.code.gson:gson:2.8.0

  1. End-Point Config Helper class that holds constants for API endpoints to be used.

Utitlity/Helper Class EndPoint.java

  1. Pagination Helper Custom implementation of RecyclerView.OnScrollListener to handle "loadmore" (Pagination) in RecyclerView.

Utitlity/Helper Class EndlessRecyclerOnScrollListener.java

Libraries com.android.support:recyclerview-v7:25.3.1

  1. Logger Utility class to be used as an alternative to Log in Android.

Utitlity/Helper Class Logger.java

  1. Session Handler Utility class to handle access token related session.public void

    setAccessToken(String iAccessToken) public String getAccessToken() public void clearSession()

Utitlity/Helper Class AppSession.java

  1. Screen Density Conversion Helper Utility class to do some minimal conversion related to android screen density.

    public static float dpToPx(Context iContext, float dp) public static float pxToDp(Context iContext, float px) public static int getScreenWidth() public static int getScreenHeight()

Utitlity/Helper Class ConversionHelper.java

  1. Date Helper Utility class to do date conversions based on your requirement like parsing date string to display date in different date formats.

Utitlity/Helper Class DateUtil.java

  1. HTML Helper Helper class to escape HTML strings.

Utitlity/Helper Class HTMLEscape.java

  1. String Helper Utility class to that provides few string related operations.

Utitlity/Helper Class StringUtils.java

  1. Network Connectivity Helper Helper class to check if the device is connected to internet (WiFi or Data connection).

Utitlity/Helper Class NetworkUtils.java

  1. ID Generator Utility class to generate unique integer IDs.

Utitlity/Helper Class NotificationId.java

  1. Dimension Config. Contains pre-defined margins and text sizes to be used within the app.

Utitlity/Helper Class dimens.xml

  1. Widget Style Config. Contains basic styling for TextView and Edittext to be used withing the app.

Utitlity/Helper Class widget_styles.xml

  1. Misc. Config. Utility class to configure Base Url for Production & Staging amongst other misc. configurations.

Utitlity/Helper Class Config.java

  1. App Compat This library adds support for the Action Bar user interface design pattern. This library includes support for material design user interface implementations.

Libraries com.android.support:appcompat-v7:25.3.1

  1. Card View This library adds support for the CardView widget, which lets you show information inside cards that have a consistent look on any app. These cards are useful for material design implementations, and are used extensively in layouts for TV apps.

Libraries com.android.support:cardview-v7:25.3.1

  1. Recycler View The "recyclerview" library adds the RecyclerView class. This class provides support for the RecyclerView widget, a view for efficiently displaying large data sets by providing a limited window of data items.

Libraries com.android.support:recyclerview-v7:25.3.1

  1. Facebook SDK Library that helps to integrate Facebook login.

Libraries com.android.support:recyclerview-v7:25.3.1

  1. Google Auth. SDK Library that helps to integrate Google login.

Libraries com.google.android.gms:play-services-auth:10.2.6

  1. Custom Font Config. Library to apply custom fonts to your app.

Libraries uk.co.chrisjenx:calligraphy:2.2.0

  1. ORM Helper Object Relational Mapping Lite (ORM Lite) provides some simple, lightweight functionality for persisting Java objects to SQL databases while avoiding the complexity and overhead of more standard ORM packages.

Libraries com.j256.ormlite:ormlite-android:5.0 com.j256.ormlite:ormlite-core:5.0


Contact:

This module has been developed in house here at WowLabz by Ritesh Dubey and Madhur Tewani from the Android team.

For feedback and suggestions on this project, you can reach out to:

For all other communication, write to us at:


Coming Soon:

  • Swift Starter
  • iOS Starter
  • React Starter