> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/mgramseva/introducing-mgramseva/platform/technical-user-docs/application-permissions-and-dependencies.md).

# Application Permissions & Dependencies

Make sure the below-mentioned permissions are allowed or accepted:

1. Internet access
2. FileStore read and write
3. Bluetooth connection
4. Request packages
5. Query all packages

## **Code Snippet**

```
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
```

[<img src="https://github.com/fluidicon.png" alt="" data-size="line">punjab-mgramseva/pubspec.yaml at develop · egovernments/punjab-mgramseva](https://github.com/egovernments/punjab-mgramseva/blob/develop/frontend/mgramseva/pubspec.yaml)

## Steps To Setup The Project  <a href="#steps-to-setup-the-project" id="steps-to-setup-the-project"></a>

Download the flutter sdk [2.8.1](https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_2.8.1-stable.zip) from [<img src="https://docs.flutter.dev/assets/images/shared/brand/flutter/icon/64.png" alt="" data-size="line">Flutter SDK releases](https://docs.flutter.dev/development/tools/sdk/releases)

Install [Android Studio](https://developer.android.com/studio?gclid=Cj0KCQiAoNWOBhCwARIsAAiHnEhdk4OIpKE17YONk6ivWbnEFDrc5RKLxJpYQldYx2v6E714Lb5W-jEaAnTHEALw_wcB\&gclsrc=aw.ds) for setting the IDE.

Open Android Studio. Open plugin preferences (**File > Settings > Plugins**) and select **Marketplace.** Select the Flutter plugin and click **Install** as shown in the image below. Click **Yes** when prompted to install the Dart plugin.

![](https://3004460086-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQx3WcyfCEvIVnLyuvkbo%2Fuploads%2FDJPuS6v2D2yhjfbyB5cI%2Fimage.png?alt=media\&token=e8281532-9c96-458d-874a-ef4454a2bb67)

Set the Flutter SDK path in android studio by navigating to (**File > Settings > Plugins > Language & Frameworks >>flutter**) flutter as shown in the image below.

![](https://3004460086-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQx3WcyfCEvIVnLyuvkbo%2Fuploads%2FkqgoQwMTMGVxc9cVrvmu%2Fimage.png?alt=media\&token=ceabbd1c-2049-4b64-beba-1095f79d3140)

Add the flutter path to the system path variable for running the flutter commands as shown in the image below.

![](https://3004460086-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQx3WcyfCEvIVnLyuvkbo%2Fuploads%2Fhl838FPm7klwYnPr8JNl%2Fimage.png?alt=media\&token=c2dce47e-6dbc-4cae-bbba-392a1efe6896)

Open a new terminal and run the **flutter doctor** command. This downloads the respective Dart SDK version and runs **flutter doctor--android-licenses** to accept the android licenses.

The steps below guide us to run the project on both Web and Mobile\
1\. Clone the project from the [Git repo](https://github.com/misdwss/punjab-mgramseva).\
2\. Open the project in android studio by selecting (**File > open**), select the flutter project (punjab-mgramseva/frontend/mgramseva) from the cloned path as shown in the image below.

![](https://3004460086-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQx3WcyfCEvIVnLyuvkbo%2Fuploads%2F34ZWCj8hXxSOykOlBck2%2Fimage.png?alt=media\&token=a5fc23b1-04ea-4c81-bb78-802a9ca4bd65)

## **Running On Android Emulator**

Select the AVD manager from the right-side top corner as shown in the image. Now, select any device by tapping on the play button. The Android Studio launches the emulator and the device is auto-selected. There are two modes for running the application - play and debug. Tap on any one of the modes to launch the mGramSeva application in the emulator as shown in the image.

![](https://3004460086-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQx3WcyfCEvIVnLyuvkbo%2Fuploads%2FKCD6PqxML9RdEbAb0Bjd%2Fimage.png?alt=media\&token=cc7cf4b4-40c5-4d11-bc16-b6ada923b47c)

## **Running On Web**

Select the chrome option from the device selection and tap on the play button. This launches the application on a chrome window.

<mark style="background-color:blue;">Note: To resolve the cors error follow the steps provided</mark> <mark style="background-color:blue;">in this</mark> [<mark style="background-color:blue;">link.</mark>](https://stackoverflow.com/questions/65630743/how-to-solve-flutter-web-api-cors-error-only-with-dart-code)<br>

## **Build Prod App Bundle - Steps**

1. &#x20;Clone the Repo → git clone [<img src="https://github.com/fluidicon.png" alt="" data-size="line">GitHub - misdwss/punjab-mgramseva](https://github.com/misdwss/punjab-mgramseva.git)
2. Navigate to mgramseva folder → cd punjab-mgramseva/frontend/mgramseva
3. Upgrade the version in the [pubspec.yml](https://github.com/misdwss/punjab-mgramseva/blob/master/frontend/mgramseva/pubspec.yaml) (version: 1.0.2+3)\
   1.0.2 => version name (which is displayed in play store)

   +3 => version code (increment by +1 every time)
4. Replace the base Url with Prod Url\
   File → [app.config.dart](https://github.com/misdwss/punjab-mgramseva/blob/master/frontend/mgramseva/lib/Env/app_config.dart)\
   \_baseUrl: window\.location.origin + "/", =>    \_baseUrl:  "[<img src="https://mgramseva-dwss.punjab.gov.in/mgramseva/icons/Icon-192.png" alt="" data-size="line">mgramseva](https://mgramseva-dwss.punjab.gov.in/) "
5. Comment the below line\
   File → [link](https://github.com/misdwss/punjab-mgramseva/blob/master/frontend/mgramseva/lib/components/HouseConnectionandBill/jsconnnector.dart)\
   export 'dart:js' show allowInterop, allowInteropCaptureThis;
6. Execute the flutter clean command →    **flutter clean**
7. Execute the flutter pub get command →  **flutter pub get**
8. Download the key-store from the below link \
   [<img src="https://developers.google.com/drive/images/drive_icon.png" alt="" data-size="line">https://drive.google.com/file/d/14teTA0nqHaFLEkgg\_LCHTcji5cRJDnXR/view?usp=sharing - Restricted link, try another account](https://drive.google.com/file/d/14teTA0nqHaFLEkgg_LCHTcji5cRJDnXR/view?usp=sharing)\
   Add this properties file to the android app folder as shown in the image below -\
   **android → key.properties** ![](https://3004460086-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQx3WcyfCEvIVnLyuvkbo%2Fuploads%2FjQfQlIW7hHdejhtXEUvb%2Fimage.png?alt=media\&token=d8043bda-bcfd-43c3-bbe0-65d055f1c42b)
9. Download the google service json from the link below\
   [<img src="https://developers.google.com/drive/images/drive_icon.png" alt="" data-size="line">google-services.json](https://drive.google.com/file/d/1USBY0a2sluHh2VwWxVcKhR7nzjkYnAmW/view?usp=sharing)\
   Add this json file to the android app folder as shown in the image below\
   **android → app → google-services.json** ![](https://3004460086-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQx3WcyfCEvIVnLyuvkbo%2Fuploads%2FcFqsek4NFGREYComVk7u%2Fimage.png?alt=media\&token=e03bd009-7e22-4a94-875e-9105aeee4779)
10. Build the prod app bundle → **flutter build appbundle**\
    Check the attached drive link below which includes the key-store, and version tracker. Update the version and release date in the sheet.\
    Path → **D:\mgramseva\_prod\punjab-mgramseva\frontend\mgramseva\build\app\outputs\bundle\release\app-release.aab**\
    [<img src="https://developers.google.com/drive/images/drive_icon.png" alt="" data-size="line">https://docs.google.com/spreadsheets/d/1aH596FxtPISIlQzxw9jO\_Ex1dttpJJvweib2F9nJj9o/edit#gid=0 - Restricted link, try another account](https://docs.google.com/spreadsheets/d/1aH596FxtPISIlQzxw9jO_Ex1dttpJJvweib2F9nJj9o/edit#gid=0)

## **Steps To Run The Integration Test On Android Device**

1\. Enable the USB debugging option on your Mobile Phone. ([Reference Link](https://www.howtogeek.com/129728/how-to-access-the-developer-options-menu-and-enable-usb-debugging-on-android-4.2/) )

2\. Connect your Phone to the system and enable File transfer.

3\. Select the AVD manager(your Phone) from the right side top corner in Android Studio

4\. Go to the frontend/mgramseva/utils/execute\_integration.sh file and run it.

5\. Integration test will start on your device.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.digit.org/mgramseva/introducing-mgramseva/platform/technical-user-docs/application-permissions-and-dependencies.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
