# App Deployment

## Android App Installation

1. You have to install Android Studio or VS code.
2. Than make sure you have installed [flutter sdk](https://mediacitydocs.gitbook.io/nexthour-app-documentation/installation/flutter-installation) in your system.
3. Import project in Android Studio or VS Code
4. Run command "flutter pub get"
5. Run command "flutter clean"
6. Make sure you have connected to **android device** or **AVD.**
7. Than go to inside **project directory\lib\common\apipath.dart**
8. Enter your domain url eg: **<https://example.com/public/>**
9. Click Play button or run command "flutter run"
10. You can change your app icon from directory **android\app\src\main\res**
11. For generate these icons of different size use website <https://makeappicon.com/> For this you need to upload you icon of size 1536 X 1536
12. Your project is running now
13. To change your app package name
    * Run this command to change the package name.flutter pub run change\_app\_package\_name:main com.new\.package.name
    * Where `com.new.package.name` is the new package name that you want for your app. replace it with any name you want
14. Change your app name **ctrl+shift+F** to **find nexthour** than **ctrl+shift+R** to **replace** it with your app name
15. Add your **Admob API** key at the path **android/app/src/main/AndroidManifest.xml**
16. Create a [Login with Amazon](https://developer.amazon.com/apps-and-games/login-with-amazon) API key for [Android](https://developer.amazon.com/docs/login-with-amazon/register-android.html).
17. Create a text file located at `{project_root}/android/app/main/assets/api_key.txt`
18. Copy-paste the contents of the API key from the Login with Amazon console into the file `{project_root}/android/app/main/assets/api_key.txt`

### **To Change Your Domain Link** <a href="#to-change-your-domain-link" id="to-change-your-domain-link"></a>

Go to lib -> common -> apipath.dart

```
class APIData {
// Replace with your domain link
 static const String domainLink = "YOUR_DOMIAN_LINK/public";
 static const String domainApiLink = domainLink+"api/";    
```

**To Add Secret key in APP**

Go to lib -> common -> apipath.dart static const String secretKey = "ENTER\_API\_SECRET\_KEY";

**To Change Your Launcher icon**

Go to android-> app-> src-> main ->res

<figure><img src="https://2663140616-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfdnmCtivPgIGEf1E3BVl%2Fuploads%2FF7jx6YZBkV0n2C1isC4I%2Fimage.png?alt=media&#x26;token=8bd43152-29e0-4404-8a1f-734560222f04" alt=""><figcaption></figcaption></figure>
