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
- Clone the Template Repository
- Open a terminal or command prompt
-
Run the following command:
-
Open the Project in Android Studio
- Launch Android Studio
- Select "Open an Existing Project"
-
Navigate to the cloned repository and select it
-
Rename the Project (Optional)
- Right-click on the root folder in the Project view
- Select Refactor > Rename
- Enter your desired project name
- Click "Refactor"
-
Update the
applicationId
in your app'sbuild.gradle
file to match your new package name -
Update Configuration
- Open
app/src/main/java/com/hawcx/template/MyApplication.java
-
Replace the placeholder API key with your actual Hawcx API key:
-
Customize the Template
- The template includes basic implementations of:
- User registration (
SignupActivity.java
) - User login (
LoginActivity.java
)
- User registration (
-
Modify these files and add your own business logic as needed
-
Run the Project
- Connect an Android device or start an emulator
- Click the "Run" button in Android Studio
Template Structure
app/src/main/java/com/hawcx/template/
MyApplication.java
: Application class with HawcxAuth initializationMainActivity.java
: Main activity demonstrating basic HawcxAuth usageLoginActivity.java
: Example implementation of secure loginSignupActivity.java
: Example implementation of secure user registrationSecureStorageManager.java
: Utility class for secure data storageapp/src/main/res/layout/
- XML layout files for activities