Developer SDK

Android examples

Install the SDK · View source on GitHub ↗

provider/src/main/AndroidManifest.xml

xml
<?xml version="1.0" encoding="utf-8"?>
<!--
The provider app: one activity, and the foreground service that owns the provider device while the
user has started providing. The installation state is in the no-backup files directory, and backups
and device transfers exclude the app's data.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />
    <!-- to pause providing on metered networks -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

    <application
        android:allowBackup="false"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/Theme.Provider">

        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service
            android:name=".ProviderService"
            android:exported="false"
            android:foregroundServiceType="specialUse">
            <property
                android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
                android:value="Provides this device's internet connection to the URnetwork network, which the user starts and stops: while it runs, other URnetwork users' traffic exits through this device and its IP address, and the app shows the clients served and the data provided." />
        </service>
    </application>
</manifest>