Skip to main content

Library for test android api's via service

Project description

Android API Testing

Upload Python Package build

Library to test the AOSP Hardware APIs

Currently Available APIs

  • Bluetooth ᛒ

    ABLE TO DO

    • Connect , Disconnect
    • Pair , UnPair
    • Enable, Disable Service Provider
    • look for more..
  • Sensor (Device Supported Sensor's)

  • Text To Speech

  • Android Runtime Permission's Based on Android API Version

  • Media Control's

  • Record Audio ⏺️

  • Wifi 👎

  • Battery 🔋

  • Make Call (or) Dial Intent 📲

  • Brightness 🔆

  • Gps ➤

  • Android Toast 🔔

  • Device Sensor Information 📡

  • Vibrator 📳

  • Share 🔗

  • Email 📧

  • Camera 📷

Android Support 📱

  • Android Background Service (Broadcast Receiver)

NOTE 💡

  • Using the Android Background Service API you can able to receive the Android Internal Event Message's
    • Aeroplane mode change's 🛩️
    • Headset adaptor state change's 🎧
    • Incoming Phone Call 📲
    • more...

Installation

pip install android-prober

Usage

  • Create main.py like the contents below.
from kivy.app import App
from kivy.lang import Builder
from android_prober import AndroidProber
from requests import get

KV = '''
BoxLayout:
    orientation: 'vertical'
    BoxLayout:
        size_hint_y: None
        height: '30sp'
        Button:
            text: 'telephony_permission'
            on_press: app.telephony_permission()
        Button:
            text: 'bluetoothPermission'
            on_press: app.bluetooth_permission()
        Button:
            text: 'locationPermission'
            on_press: app.location_permission()

    ScrollView:
        Label:
            id: label
            size_hint_y: None
            height: self.texture_size[1]
            text_size: self.size[0], None
'''

class BluetoothTestViaWebService(App):
    
    BASE_URL = "http://localhost:5000"

    def init(self):
        """ while using webservice to invoke the API's """
        TesterApp.use_flaskapp()

    def on_pause(self):
        return True

    def telephony_permission(self):
        response = get(f"{BASE_URL}/telephony_permission")
        print(response.json)

    def location_permission(self):
        response = get(f"{BASE_URL}/location_permission")
        print(response.json)

    def bluetooth_permission(self):
        response = get(f"{BASE_URL}/bluetooth_permission")
        print(response.json)

    def build(self):
        self.init()
        self.root = Builder.load_string(KV)
        return self.root

if __name__ == '__main__':
    BluetoothTestViaWebService().run()
  • Create main.py without webservice.
from kivy.app import App
from kivy.lang import Builder
from android_prober import AndroidProber
from android_prober import bluetooth

KV = '''
BoxLayout:
    orientation: 'vertical'
    BoxLayout:
        size_hint_y: None
        height: '30sp'
        Button:
            text: 'telephony_permission'
            on_press: app.telephony_permission()
        Button:
            text: 'bluetoothPermission'
            on_press: app.bluetooth_permission()
        Button:
            text: 'locationPermission'
            on_press: app.location_permission()

    ScrollView:
        Label:
            id: label
            size_hint_y: None
            height: self.texture_size[1]
            text_size: self.size[0], None
'''

class BluetoothTest(App):

    def on_pause(self):
        return True

    def bluetooth_permission(self):
       response = bluetooth.bluetooth_permission()
        print(response)

    def build(self):
        self.root = Builder.load_string(KV)
        return self.root

if __name__ == '__main__':
    BluetoothTest().run()

Build & Run

pip install -r requirements.txt

buildozer android debug

Install the generated apk into the target device.

Documentation

  • python for android webview recipe internally start and serve's web service running on port 5000.

  • You can also test api on Single Click.

image

  • Connect the device using ADB.

  • If your using adb via cable, Run this to expose the port tcp/5000

adb forward tcp:5000 tcp:5000

Upcomming updates

-> https://github.com/gunaNeelamegam/android-prober/issues

  • Stablity
  • API for All Other Interface's
  • FastAPI Intergration

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

android_prober-0.1.6.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

android_prober-0.1.6-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

Details for the file android_prober-0.1.6.tar.gz.

File metadata

  • Download URL: android_prober-0.1.6.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for android_prober-0.1.6.tar.gz
Algorithm Hash digest
SHA256 0049da738642d3c4b57ae2853436cbd2e52754685b60ad3728f6c6434489a3d5
MD5 e701fdf9ade7147f32e15b03726dbec9
BLAKE2b-256 fb93448109334146e1b1042ff47f7d14b8fa4f0fd58602edb23f02d69fb29adb

See more details on using hashes here.

File details

Details for the file android_prober-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for android_prober-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 92d5f06166c34ea8e51222acf243f75be6d6d3d318657b8e69d390785bdfda98
MD5 0c30b7f41f44eb0f081ee1bd5da0f61d
BLAKE2b-256 b4643abd5ecd607e97f010b2aab4f7f19d8d75bb45b53769dc57df92aadc01e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page