Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/osfunapps/os-android-app-automation-py

Will prepare an Android app by properties defined by a xml file
https://github.com/osfunapps/os-android-app-automation-py

Last synced: 27 days ago
JSON representation

Will prepare an Android app by properties defined by a xml file

Awesome Lists containing this project

README

        

Introduction
------------

This module aim to assist with an Android app buildup.

To use, create an XML file with your app properties and run.

## Installation
Install via pip:
```python
pip install os-android-app-automation
```
## Usage:

Create an XML file with your app properties:

- [xml example 1](/examples/example_1.xml):
```xml




false




/path/to/Android/studio/project




ca-app-pub-32050407656945904~1094096384
/path/to/google-services.json
com.company_name.product_name
App Name
1
1.0


/path/to/app/launcher/files/main


/path/to/assets



module_1
module_2
module_3



implementation 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'

// gson
implementation 'com.google.code.gson:gson:2.8.6'

// glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
kapt 'com.github.bumptech.glide:compiler:4.11.0'

// all of the other dependencies...

```
After your created the XML file, call it from code:
```python
from os_android_app_automation import app_automation

app_automation.set_android_project_by_xml(xml_path='path/to/xml/file.xml',
place_holder_map={'$project_path': 'path/to/android/project'}, # optional define in runtime
on_backup=on_backup, // optional call back here
on_pre_build=on_pre_build // optional callback here
)

# optional callbacks:

# this callback will be fired before the process begins. You can clear files, remove directories and etc...
# notice that the package name here is the old package name of the project (the automation didn't changed anything yet)
def on_backup(project_path, old_package_name):
pass

# this callback will be fired right before the build will commence. i.e. after package name change, assets copy and essentially, before apk/bundle creation
def on_pre_build(project_path, package_name):
pass
```

# Advanced Usage:

You can also extend an XML file to another one.

Inheritance in this sense can help you if you're interested in sharing a behaviour between a bunch of XML files.

- [child xml](/examples/child_xml_example.xml):
```xml


ca-app-pub-12345678798~546
com.osfunapps.my_package_name
MyAppName
12
1.2



another_module



implementation 'com.squareup.okhttp3:okhttp:4.9.0'

```

- [parent xml](/examples/parent_xml_example.xml):
```xml


false


/path/to/project
/path/to/google/services.json
/path/to/launcher/directories
/path/to/assets


module_1
module_2
module_3


implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'

// the rest of the modules dependencies will come from the child

```

That's it. Now you can just call the xml of the child (if you set placeholders in the xml, don't forget to set them when you call the function).

And more...

## Links
[GitHub - osapps](https://github.com/osfunapps)

## Licence
ISC