Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/gradle_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ jobs:
chmod +x ./gradlew
./gradlew build -x test -x osgi -x lintDebug -x javadoc

- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: osh-android-APK
path: sensorhub-android-app/build/outputs/apk/debug/sensorhub-android-app-debug.apk
# - name: Upload APK artifact
# uses: actions/upload-artifact@v4
# with:
# name: osh-android-APK
# path: sensorhub-android-app/build/outputs/apk/debug/sensorhub-android-app-debug.apk

- name: Create GitHub Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: sensorhub-android-app/build/outputs/apk/debug/*.apk
generate_release_notes: true
# - name: Create GitHub Release
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# uses: softprops/action-gh-release@v2
# with:
# files: sensorhub-android-app/build/outputs/apk/debug/*.apk
# generate_release_notes: true
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext.oshCoreVersion = '2.0.0-beta'
ext.compileSdkVersion = 34
ext.minSdkVersion = 33
ext.targetSdkVersion = 30
ext.targetSdkVersion = 34
ext.buildToolsVersion = "34.0.0"
version = '4.1.0'

Expand All @@ -12,7 +12,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.2.2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20'
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 6 additions & 5 deletions sensorhub-android-app/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.sensorhub.android"
android:hardwareAccelerated="true">

<uses-feature android:name="android.hardware.location" />
<uses-feature android:name="android.hardware.sensor.compass" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.usb.accessory" android:required="true" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
<uses-feature android:name="android.hardware.usb.accessory" android:required="false" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false" />
<uses-feature android:name="android.hardware.camera2.full" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand All @@ -28,6 +27,9 @@
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
Expand Down Expand Up @@ -87,8 +89,7 @@
android:name=".SensorHubService"
android:enabled="true"
android:foregroundServiceType="location|camera|microphone"
android:exported="false"
tools:ignore="ForegroundServicePermission" />
android:exported="false" />

<!-- <receiver android:name=".RestartSensorHubReceiver"-->
<!-- android:exported="false" />-->
Expand Down
6 changes: 3 additions & 3 deletions sensorhub-android-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ allprojects {
exclude group: 'ch.qos.logback', module: 'logback-core'

resolutionStrategy {
force "org.jetbrains.kotlin:kotlin-stdlib:1.8.10"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10"
force "org.jetbrains.kotlin:kotlin-stdlib:1.9.20"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.20"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.20"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
android:layout_height="wrap_content"
android:inputType="text"
android:singleLine="true"
android:text="/sensorhub/api"/>
android:text="@string/default_endpoint_path"/>
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.materialswitch.MaterialSwitch
Expand Down
1 change: 1 addition & 0 deletions sensorhub-android-app/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@
<string name="hint_host_ip">Host / IP</string>
<string name="hint_port">Port</string>
<string name="hint_endpoint_path">Endpoint path</string>
<string name="default_endpoint_path" translatable="false">/sensorhub/api</string>
<string name="switch_enable_tls">Enable TLS</string>
<string name="switch_disable_ssl">Disable SSL Validation</string>
<string name="section_authentication">AUTHENTICATION</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.LocaleList;
import android.preference.PreferenceManager;
import androidx.preference.PreferenceManager;

import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
import androidx.preference.PreferenceManager;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.TextureView;
Expand Down Expand Up @@ -386,7 +386,7 @@ protected void startRefreshingStatus() {
displayCallback = new Runnable() {
public void run() {
displayStatus();
videoInfoArea.setText(Html.fromHtml(videoInfoText.toString()));
videoInfoArea.setText(Html.fromHtml(videoInfoText.toString(), Html.FROM_HTML_MODE_LEGACY));
displayHandler.postDelayed(this, 1000);
}
};
Expand Down
21 changes: 9 additions & 12 deletions sensorhub-android-app/src/org/sensorhub/android/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import android.os.Bundle;
import android.os.IBinder;
import android.os.PowerManager;
import android.preference.PreferenceManager;
import androidx.preference.PreferenceManager;
import android.provider.Settings.Secure;
import android.util.Log;
import android.view.KeyEvent;
Expand Down Expand Up @@ -630,16 +630,13 @@ else if (sensorsFragment != null && !sensorsFragment.isHidden())
BottomNavigationView bottomNav = findViewById(R.id.bottom_nav);

bottomNav.setOnNavigationItemSelectedListener(item -> {
switch (item.getItemId()) {
case R.id.dashboard:
switchFragment(homeFragment, getString(R.string.app_name));
break;
case R.id.sensors:
switchFragment(sensorsFragment, getString(R.string.tab_sensors));
break;
case R.id.settings:
switchFragment(settingsFragment, getString(R.string.tab_settings));
break;
int itemId = item.getItemId();
if (itemId == R.id.dashboard) {
switchFragment(homeFragment, getString(R.string.app_name));
} else if (itemId == R.id.sensors) {
switchFragment(sensorsFragment, getString(R.string.tab_sensors));
} else if (itemId == R.id.settings) {
switchFragment(settingsFragment, getString(R.string.tab_settings));
}
return true;
});
Expand Down Expand Up @@ -865,6 +862,6 @@ public void onReceive(Context context, Intent intent) {
};
IntentFilter filter = new IntentFilter();
filter.addAction(ACTION_BROADCAST_RECEIVER);
registerReceiver(broadcastReceiver, filter);
registerReceiver(broadcastReceiver, filter, RECEIVER_NOT_EXPORTED);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void onReceive(Context context, Intent intent)
IntentFilter filter = new IntentFilter();
filter.addAction(ACTION_SOS);

androidContext.registerReceiver(receiver, filter);
androidContext.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void onReceive(Context context, Intent intent) {
IntentFilter filter = new IntentFilter();
filter.addAction(ACTION_PROXY);

androidContext.registerReceiver(receiver, filter);
androidContext.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED);

Log.d(TAG, "Starting Proxy Sensor");

Expand Down
7 changes: 4 additions & 3 deletions sensorhub-android-blebeacon/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
implementation project(path: ':sensorhub-core')
// implementation 'org.altbeacon:android-beacon-library:2.16.2'
// implementation 'org.altbeacon:android-beacon-library:2.13.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.sensorhub.impl.sensor.blebeacon;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
3 changes: 1 addition & 2 deletions sensorhub-android-blebeacon/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sensorhub.impl.sensor.blebeacon">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
1 change: 0 additions & 1 deletion sensorhub-android-controller/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sensorhub.impl.sensor.controller"
xmlns:tools="http://schemas.android.com/tools">
<!-- android:versionCode="1"-->
<!-- android:versionName="1.0"-->
Expand Down
5 changes: 1 addition & 4 deletions sensorhub-android-flirone/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sensorhub.impl.driver.flir"
android:versionCode="1"
android:versionName="1.0" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
5 changes: 1 addition & 4 deletions sensorhub-android-lib/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sensorhub.android.lib"
android:versionCode="1"
android:versionName="1.0" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
Expand Down
9 changes: 0 additions & 9 deletions sensorhub-android-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,14 @@ dependencies {
api project(':sensorhub-driver-angelsensor')
api project(':sensorhub-driver-android')
api project(':sensorhub-driver-kestrel')
// api project(':sensorhub-android-garmin')
// api project(':sensorhub-driver-flirone')
// api project(':sensorhub-client-consys-okhttp')
// api project(':sensorhub-android-flirone')
//api project(':sensorhub-android-dji')
// api project(':sensorhub-storage-h2')

implementation 'org.slf4j:slf4j-android:1.6.1-RC1'
implementation('javax.xml.stream:stax-api:1.0-2')
}

configurations {
api {
// exclude stuff from APK
// exclude group: "javax.servlet"
exclude group: "xml-apis"
// exclude group: "org.eclipse.jetty"
exclude group: "org.n52.amused"
exclude group: "ch.qos.logback"
exclude group: "org.apache.felix"
Expand Down
2 changes: 1 addition & 1 deletion sensorhub-android-meshtastic/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
api project(':sensorhub-core')
implementation ('org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5')
implementation("com.google.protobuf:protobuf-java:4.33.0")
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation project(':sensorhub-android-service')
implementation project(':sensorhub-driver-android')
}
Expand Down
5 changes: 1 addition & 4 deletions sensorhub-android-meshtastic/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sensorhub.impl.sensor.meshtastic">

<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="33" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
Expand Down
3 changes: 1 addition & 2 deletions sensorhub-android-polar/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.sensorhub.impl.sensor.polar">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.BODY_SENSORS" />

Expand Down
5 changes: 1 addition & 4 deletions sensorhub-android-service/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sensorhub.android.service"
android:versionCode="1"
android:versionName="1.0" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void onReceive(Context context, Intent intent)
}
}
}
}, filter); // Don't forget to unregister during onDestroy
}, filter, Context.RECEIVER_EXPORTED);

// Getting the Bluetooth adapter
BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
Expand Down
2 changes: 1 addition & 1 deletion sensorhub-android-ste/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ext.details = 'Driver for STE Radiation Pager'

dependencies {
api project(':sensorhub-core')
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation project(':sensorhub-android-service')
implementation project(':sensorhub-driver-android')

Expand Down
5 changes: 1 addition & 4 deletions sensorhub-android-ste/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sensorhub.impl.sensor.ste">

<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="33" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
Expand Down
3 changes: 1 addition & 2 deletions sensorhub-android-template/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sensorhub.impl.sensor.wardriving">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- WiFi scanning -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Expand Down
3 changes: 2 additions & 1 deletion sensorhub-android-template/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ dependencies {
implementation 'io.reactivex.rxjava3:rxjava:3.1.6'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.2'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation project(path: ':sensorhub-driver-android')
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.core:core:1.5.0'

implementation project(path: ':sensorhub-driver-android')
}
configurations.configureEach {
exclude group: "ch.qos.logback"
Expand Down
3 changes: 1 addition & 2 deletions sensorhub-android-wardriving/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sensorhub.impl.sensor.wardriving">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- WiFi scanning -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void onReceive(Context ctx, Intent intent) {
};

IntentFilter filter = new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
context.registerReceiver(wifiReceiver, filter);
context.registerReceiver(wifiReceiver, filter, Context.RECEIVER_EXPORTED);

// start GPS location updates
startLocationUpdates();
Expand Down
5 changes: 1 addition & 4 deletions sensorhub-driver-android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sensorhub.impl.sensor.android"
android:versionCode="1"
android:versionName="1.0" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
Expand Down
Loading