Skip to content

Starting from a Template Project

Get up and running quickly with our pre-configured Hawcx template project. This approach is perfect for developers who want to start with a solid foundation and best practices already in place.

Prerequisites

  • Android Studio installed on your development machine
  • Git installed on your system

Steps

  1. Clone the Template Repository
  2. Open a terminal or command prompt
  3. Run the following command:

    git clone https://github.com/hawcx/authenticator
    

  4. Open the Project in Android Studio

  5. Launch Android Studio
  6. Select "Open an Existing Project"
  7. Navigate to the cloned repository and select it

  8. Rename the Project (Optional)

  9. Right-click on the root folder in the Project view
  10. Select Refactor > Rename
  11. Enter your desired project name
  12. Click "Refactor"
  13. Update the applicationId in your app's build.gradle file to match your new package name

  14. Update Configuration

  15. Open app/src/main/java/com/hawcx/template/MyApplication.java
  16. Replace the placeholder API key with your actual Hawcx API key:

    HawcxInitializer.getInstance().init(this, "YOUR_API_KEY_HERE");
    

  17. Customize the Template

  18. The template includes basic implementations of:
    • User registration (SignupActivity.java)
    • User login (LoginActivity.java)
  19. Modify these files and add your own business logic as needed

  20. Run the Project

  21. Connect an Android device or start an emulator
  22. Click the "Run" button in Android Studio

Template Structure

  • app/src/main/java/com/hawcx/template/
  • MyApplication.java: Application class with HawcxAuth initialization
  • MainActivity.java: Main activity demonstrating basic HawcxAuth usage
  • LoginActivity.java: Example implementation of secure login
  • SignupActivity.java: Example implementation of secure user registration
  • SecureStorageManager.java: Utility class for secure data storage
  • app/src/main/res/layout/
  • XML layout files for activities