Compare commits

..

1 Commits

Author SHA1 Message Date
6a0b429a22 added usbserial lib 2022-03-31 21:31:40 +02:00
12 changed files with 131 additions and 710 deletions

73
LICENSE
View File

@ -1,73 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,22 +1,2 @@
# ExternGnss # ExternGnss
Display smartphone GNSS data and external GNSS from a serial module via OTG. Show distance between the both fixes.
<img src="https://git.mosad.xyz/localhorst/ExternGnss/raw/commit/a3b6942042d46e244439895a88e1d3977fae371f/Screenshot_20220425-213544_ExternGNSS.png" height="500">
## Used Libs
[usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) as the OTG serial driver.
## External GNSS module
For testing a Ublox NEO 8 was used with a FTDI FT232R. Just connect the TX/RX pairs and select 5V for the module.
- [FTDI FT232R](https://www.ebay.com/itm/165323481324)
- [Ublox NEO 8 GNSS](https://de.aliexpress.com/item/4000597350406.html)
## Tip for USB-free ADB connection
- connect the device via USB
- set the adb server to network debugging: `adb tcpip 5555`
- get the device IP address: `adb shell ip addr show wlan0`
- connecy the device via network: `adb connect ip-address-of-device:5555`
- verify the network connection: `adb devices`
- unplug the USB cable from device
- the device should still be attached via network to adb

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

View File

@ -4,7 +4,7 @@ android {
compileSdkVersion 30 compileSdkVersion 30
defaultConfig { defaultConfig {
applicationId "hendrikschutter.com.externgnss" applicationId "hendrikschutter.com.externgnss"
minSdkVersion 19 minSdkVersion 17
targetSdkVersion 30 targetSdkVersion 30
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
@ -27,5 +27,5 @@ dependencies {
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.github.mik3y:usb-serial-for-android:3.4.3' implementation 'com.github.mik3y:usb-serial-for-android:3.4.4'
} }

View File

@ -4,7 +4,6 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android." />
<application <application
android:allowBackup="true" android:allowBackup="true"
@ -17,14 +16,9 @@
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/usb_serial_devices"/>
</activity> </activity>
</application> </application>

View File

@ -0,0 +1,65 @@
package hendrikschutter.com.externgnss;
import android.content.Context;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbManager;
import android.util.Log;
import android.widget.EditText;
import com.hoho.android.usbserial.driver.UsbSerialDriver;
import com.hoho.android.usbserial.driver.UsbSerialPort;
import com.hoho.android.usbserial.driver.UsbSerialProber;
import com.hoho.android.usbserial.util.SerialInputOutputManager;
import java.io.IOException;
import java.util.List;
public class ExternGNSS implements SerialInputOutputManager.Listener {
private MainActivity uiactivity;
ExternGNSS(UsbManager manager, MainActivity mainactivity) {
Log.i("HAG", "init extern gnss");
this.uiactivity = mainactivity;
// Find all available drivers from attached devices.
List<UsbSerialDriver> availableDrivers = UsbSerialProber.getDefaultProber().findAllDrivers(manager);
if (availableDrivers.isEmpty()) {
return;
}
// Open a connection to the first available driver.
UsbSerialDriver driver = availableDrivers.get(0);
UsbDeviceConnection connection = manager.openDevice(driver.getDevice());
if (connection == null) {
// add UsbManager.requestPermission(driver.getDevice(), ..) handling here
return;
}
UsbSerialPort port = driver.getPorts().get(0); // Most devices have just one port (port 0)
try {
port.open(connection);
port.setParameters(9600, 8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE);
SerialInputOutputManager usbIoManager = new SerialInputOutputManager(port, this);
usbIoManager.start();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void onNewData(byte[] data) {
//runOnUiThread(() -> { textView.append(new String(data)); });
Log.i("HAG", new String(data));
if( this.uiactivity != null){
this.uiactivity.setExternGnss(new String(data));
}
}
@Override
public void onRunError(Exception e) {
}
}

View File

@ -2,57 +2,41 @@ package hendrikschutter.com.externgnss;
import android.Manifest; import android.Manifest;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.hardware.usb.UsbManager;
import android.graphics.Color;
import android.location.LocationListener; import android.location.LocationListener;
import android.location.LocationManager; import android.location.LocationManager;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import pub.devrel.easypermissions.AfterPermissionGranted; import pub.devrel.easypermissions.AfterPermissionGranted;
import pub.devrel.easypermissions.EasyPermissions; import pub.devrel.easypermissions.EasyPermissions;
import static java.lang.Thread.sleep; import static java.lang.Thread.sleep;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
private TextView output; private TextView output;
private LocationManager locationManager = null; private LocationManager locationManager;
private SerialUSB serialUSB = null;
private NMEAParser nmeaParser = null;
private boolean doRun = true; private boolean doRun = true;
private final Context cntxToastInternGNSSUpdate = this; private final Context cntxToastInternGNSSUpdate = this;
final String[] perms = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.INTERNET,}; final String[] perms = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.INTERNET};
private static final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB";
private boolean bChange = true; private boolean bChange = true;
private BlockingQueue<Byte> rawSerialByteDataQueue = null;
private double lastInternFixLat, lastInternFixLon;
private MainActivity activity = this;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
startLocationInit();
UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
Log.i("HAG", "init app");
ExternGNSS tmp = new ExternGNSS(manager, this);
// start intern GNSS and display stats on UI
startInternGNSS();
// start extern GNSS and display stats on UI
startExternGNSS();
} }
// From https://github.com/googlesamples/easypermissions // From https://github.com/googlesamples/easypermissions
@Override @Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
@ -61,51 +45,19 @@ public class MainActivity extends AppCompatActivity {
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this); EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
} }
private void startExternGNSS() {
rawSerialByteDataQueue = new LinkedBlockingQueue<>();
serialUSB = new SerialUSB(this, rawSerialByteDataQueue);
nmeaParser = new NMEAParser();
if (serialUSB.findSerialDevice()) {
serialUSB.connect(9600, 0);
if (serialUSB.isConnected()) {
nmeaParser.setReceiveByteStream(rawSerialByteDataQueue);
((FloatingActionButton)findViewById(R.id.floatingActionButtonExternGnssInfo)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String otgInfo = "OTG-Info:\n Vendor: " + serialUSB.getUsbDeviceVendorId()+ "" +
"\n Device: " + serialUSB.getDeviceId() +
"\n Baudrate: " + String.valueOf(serialUSB.getBaudRate() +
"\n\nNMEA:\n Sentences: " + String.valueOf(nmeaParser.getSentenceCounter()));
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setMessage(otgInfo)
.setPositiveButton("Close", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
builder.create().show();
}
});
}
}
}
@AfterPermissionGranted(123) @AfterPermissionGranted(123)
private void startInternGNSS() { private void startLocationInit() {
if (EasyPermissions.hasPermissions(this, perms)) { if (EasyPermissions.hasPermissions(this, perms)) {
// Already have permission, do the thing // Already have permission, do the thing
Toast.makeText(cntxToastInternGNSSUpdate, "Permission granted!", Toast.LENGTH_SHORT).show(); Toast.makeText(cntxToastInternGNSSUpdate, "Permission granted!", Toast.LENGTH_SHORT).show();
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
} else { } else {
// Do not have permissions, request them now // Do not have permissions, request them now
EasyPermissions.requestPermissions(this, "We require location access!", EasyPermissions.requestPermissions(this, "We require location access!!!",
123, perms); 123, perms);
} }
} }
private void setEditTextLabel(final EditText v, final String str) { private void setEditTextLabel(final EditText v, final String str) {
Runnable myRun = new Runnable() { Runnable myRun = new Runnable() {
public void run() { public void run() {
@ -115,28 +67,23 @@ public class MainActivity extends AppCompatActivity {
runOnUiThread(myRun); runOnUiThread(myRun);
} }
private void setTextViewLabel(final TextView v, final String str) { public void setExternGnss( final String str) {
Runnable myRun = new Runnable() { Runnable myRun = new Runnable() {
public void run() { public void run() {
v.setText(str); final TextView v = (TextView) findViewById(R.id.externGNSSTextView);
v.append(str);
} }
}; };
runOnUiThread(myRun); runOnUiThread(myRun);
} }
@SuppressLint("MissingPermission") @SuppressLint("MissingPermission")
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
setInternGnssUiNoSignal();
setExternGnssUiNoSignal();
setInternGnssUiColor(Color.GRAY);
setExternGnssUiColor(Color.GRAY);
if (!EasyPermissions.hasPermissions(this, perms)) { if (!EasyPermissions.hasPermissions(this, perms)) {
// Dummy thread ... // Dummy thread ...
/*
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -150,58 +97,40 @@ public class MainActivity extends AppCompatActivity {
} }
} }
}).start(); }).start();
*/
} else { } else {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); if(locationManager != null){
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
}
// Worker-Thread // Worker-Thread
new Thread( new Thread(
new Runnable() { new Runnable() {
@Override @Override
public void run() { public void run() {
while (doRun) { while (doRun && (locationManager != null)) {
if (locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER) != null) { if (locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER) != null) {
setInternGnssUiColor(Color.BLACK); setEditTextLabel((EditText) findViewById(R.id.interngnssLatNumber), String.format( "%.6f", locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getLatitude()));
lastInternFixLat = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getLatitude(); setEditTextLabel((EditText) findViewById(R.id.interngnssLongNumber), String.format( "%.6f", locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getLongitude()));
lastInternFixLon = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getLongitude(); setEditTextLabel((EditText) findViewById(R.id.interngnssAltitudeNumber), String.format( "%.2f", locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getAltitude()) + " m");
setEditTextLabel((EditText) findViewById(R.id.interngnssLatNumber), String.format("%.6f", lastInternFixLat)); setEditTextLabel((EditText) findViewById(R.id.interngnssAccuracyNumber), String.format( "%.2f", locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getAccuracy()) + " m");
setEditTextLabel((EditText) findViewById(R.id.interngnssLongNumber), String.format("%.6f", lastInternFixLon));
setEditTextLabel((EditText) findViewById(R.id.interngnssAltitudeNumber), String.format("%.2f", locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getAltitude()) + " m");
setEditTextLabel((EditText) findViewById(R.id.interngnssAccuracyNumber), String.format("%.2f", locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getAccuracy()) + " m");
setEditTextLabel((EditText) findViewById(R.id.interngnssSatCountNumber), Integer.toString(locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getExtras().getInt("satellites"))); setEditTextLabel((EditText) findViewById(R.id.interngnssSatCountNumber), Integer.toString(locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getExtras().getInt("satellites")));
} else { }else{
setInternGnssUiColor(Color.GRAY); setEditTextLabel((EditText) findViewById(R.id.interngnssLatNumber), "no signal");
setInternGnssUiNoSignal(); setEditTextLabel((EditText) findViewById(R.id.interngnssLongNumber), "no signal");
setEditTextLabel((EditText) findViewById(R.id.diffGNSSDistanceNumber), "no data"); setEditTextLabel((EditText) findViewById(R.id.interngnssAltitudeNumber), "no signal");
setEditTextLabel((EditText) findViewById(R.id.interngnssAccuracyNumber), "no signal");
setEditTextLabel((EditText) findViewById(R.id.interngnssSatCountNumber),"no signal");
} }
runOnUiThread(new Runnable() {
if ((serialUSB != null) && (nmeaParser != null)) { @Override
if (serialUSB.isConnected()) { public void run() {
setTextViewLabel((TextView) findViewById(R.id.externgnssNameTextView), "Extern GNSS receiver"); //Update
nmeaParser.handleReceiveByteStream();
if (nmeaParser.checkFix() == true) {
setExternGnssUiColor(Color.BLACK);
//Log.i("ExternGNSS", "Fix! Lat: " + String.valueOf(nmeaParser.getLatitude()) + " Lon: " + String.valueOf(nmeaParser.getLongitude()));
setEditTextLabel((EditText) findViewById(R.id.externgnssLatNumber), String.format("%.6f", nmeaParser.getLatitude()));
setEditTextLabel((EditText) findViewById(R.id.externgnssLongNumber), String.format("%.6f", nmeaParser.getLongitude()));
setEditTextLabel((EditText) findViewById(R.id.externgnssSatCountNumber), Integer.toString(nmeaParser.getSatCount()));
}
} else {
setTextViewLabel((TextView) findViewById(R.id.externgnssNameTextView), "Extern GNSS receiver (offline)");
setExternGnssUiColor(Color.GRAY);
setExternGnssUiNoSignal();
setEditTextLabel((EditText) findViewById(R.id.diffGNSSDistanceNumber), "no data");
} }
});
if ((locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER) != null) && (serialUSB != null) && (nmeaParser != null)) {
if (nmeaParser.checkFix() == true) {
setEditTextLabel((EditText) findViewById(R.id.diffGNSSDistanceNumber), String.format("%.6f", nmeaParser.calcDistance(lastInternFixLat, lastInternFixLon)) + " m");
}
} else {
setEditTextLabel((EditText) findViewById(R.id.diffGNSSDistanceNumber), "no signal");
}
}
try { try {
sleep(1000); sleep(10000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -220,55 +149,19 @@ public class MainActivity extends AppCompatActivity {
doRun = false; doRun = false;
} }
private void setInternGnssUiColor(int color){
((TextView) findViewById(R.id.interngnssLatTextView)).setTextColor(color);
((TextView) findViewById(R.id.interngnssLongTextView)).setTextColor(color);
((TextView) findViewById(R.id.interngnssAccuracyTextView)).setTextColor(color);
((TextView) findViewById(R.id.interngnssAltitudeTextView)).setTextColor(color);
((TextView) findViewById(R.id.interngnssSatCountTextView)).setTextColor(color);
((EditText) findViewById(R.id.interngnssLatNumber)).setTextColor(color);
((EditText) findViewById(R.id.interngnssLongNumber)).setTextColor(color);
((EditText) findViewById(R.id.interngnssAccuracyNumber)).setTextColor(color);
((EditText) findViewById(R.id.interngnssAltitudeNumber)).setTextColor(color);
((EditText) findViewById(R.id.interngnssSatCountNumber)).setTextColor(color);
}
private void setExternGnssUiColor(int color){
((TextView) findViewById(R.id.externgnssLatTextView)).setTextColor(color);
((TextView) findViewById(R.id.externgnssLongTextView)).setTextColor(color);
((TextView) findViewById(R.id.externgnssSatCountTextView)).setTextColor(color);
((EditText) findViewById(R.id.externgnssLatNumber)).setTextColor(color);
((EditText) findViewById(R.id.externgnssLongNumber)).setTextColor(color);
((EditText) findViewById(R.id.externgnssSatCountNumber)).setTextColor(color);
}
private void setInternGnssUiNoSignal(){
setEditTextLabel((EditText) findViewById(R.id.interngnssLatNumber), "no signal");
setEditTextLabel((EditText) findViewById(R.id.interngnssLongNumber), "no signal");
setEditTextLabel((EditText) findViewById(R.id.interngnssAltitudeNumber), "no signal");
setEditTextLabel((EditText) findViewById(R.id.interngnssAccuracyNumber), "no signal");
setEditTextLabel((EditText) findViewById(R.id.interngnssSatCountNumber), "no signal");
}
private void setExternGnssUiNoSignal(){
setEditTextLabel((EditText) findViewById(R.id.externgnssLatNumber), "no signal");
setEditTextLabel((EditText) findViewById(R.id.externgnssLongNumber), "no signal");
setEditTextLabel((EditText) findViewById(R.id.externgnssSatCountNumber), "no signal");
setEditTextLabel((EditText) findViewById(R.id.diffGNSSDistanceNumber), "no signal");
}
LocationListener locationListener = new LocationListener() { LocationListener locationListener = new LocationListener() {
@Override @Override
public void onLocationChanged(android.location.Location location) { public void onLocationChanged(android.location.Location location) {
//double latitude = location.getLatitude();
//double longitude = location.getLongitude();
//String msg = "New Latitude: " + latitude + " New Longitude: " + longitude;
Toast.makeText(cntxToastInternGNSSUpdate, "Internal GNSS updated", Toast.LENGTH_LONG).show(); Toast.makeText(cntxToastInternGNSSUpdate, "Internal GNSS updated", Toast.LENGTH_LONG).show();
} }
@Override @Override
// This callback will never be invoked on Android Q and above. // This callback will never be invoked on Android Q and above.
public void onStatusChanged(String provider, int status, Bundle extras) { public void onStatusChanged(String provider, int status, Bundle extras) {
// Toast.makeText(mContext, "Status Changed", Toast.LENGTH_LONG).show(); // Toast.makeText(mContext, "Status Changed", Toast.LENGTH_LONG).show();
} }
@Override @Override

View File

@ -1,128 +0,0 @@
package hendrikschutter.com.externgnss;
import android.util.Log;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.BlockingQueue;
public class NMEAParser {
private double latitude;
private double longitude;
private boolean fix;
private int satCount;
private int sentenceCounter;
private BlockingQueue<Byte> rawByteData = null;
public NMEAParser() {
this.fix = false;
this.satCount = 0;
this.latitude = 0;
this.longitude = 0;
this.sentenceCounter = 0;
}
public void setReceiveByteStream(BlockingQueue<Byte> rawData) {
this.rawByteData = rawData;
}
/**
* find strings in raw data and sent them to parse
*/
public void handleReceiveByteStream() {
String nmeaSentence;
ByteArrayOutputStream rawDataByteStream = new ByteArrayOutputStream();
//wait for sufficient data in buffer TODO don't do this block wise, losing data in edge
if (this.rawByteData.size() > 512) {
for (Iterator<Byte> rawByte = this.rawByteData.iterator(); rawByte.hasNext(); ) {
rawDataByteStream.write(rawByte.next());
rawByte.remove(); //remove this data from stream
}
ByteArrayInputStream stream = new ByteArrayInputStream(rawDataByteStream.toByteArray());
InputStreamReader streamReader = new InputStreamReader(stream, StandardCharsets.US_ASCII);
BufferedReader bufferedReader = new BufferedReader(streamReader);
try {
while ((nmeaSentence = bufferedReader.readLine()) != null) {
//Log.i("NMEAParser", nmeaSentence);
this.parseSentence(nmeaSentence);
}
} catch (IOException e) {
e.printStackTrace();
}
} else {
//Log.i("NMEAParser", "wait for more data in buffer");
}
}
public int getSentenceCounter(){
return this.sentenceCounter;
}
public void parseSentence(String sentence) {
this.sentenceCounter++;
if (sentence.startsWith("$GNGLL")) {
parseGNGLL(sentence);
}
if (sentence.startsWith("$GPGSV")) {
parseGPGSV(sentence);
}
}
private void parseGNGLL(String sentence) {
if (sentence.length() >= 45) {
if (sentence.substring(44, 45).equals("A")) {
this.fix = true;
this.latitude = (Double.parseDouble(sentence.substring(9, 17)) / 60) + Double.parseDouble(sentence.substring(7, 9));
this.longitude = (Double.parseDouble(sentence.substring(23, 30)) / 60) + Double.parseDouble(sentence.substring(20, 23));
} else {
this.fix = false;
}
}
}
private void parseGPGSV(String sentence) {
if (sentence.length() >= 13) {
this.satCount = (Integer.parseInt(sentence.substring(11, 13)));
}
}
public double calcDistance(double latitude, double longitude) {
final int R = 6371; // Radius of the earth
double latDistance = Math.toRadians(latitude - this.latitude);
double lonDistance = Math.toRadians(longitude - this.longitude);
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)
+ Math.cos(Math.toRadians(this.latitude)) * Math.cos(Math.toRadians(latitude))
* Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double distance = R * c * 1000; // convert to meters
distance = Math.pow(distance, 2);
return Math.sqrt(distance);
}
public double getLatitude() {
return this.latitude;
}
public double getLongitude() {
return this.longitude;
}
public boolean checkFix() {
return this.fix;
}
public int getSatCount() {
return this.satCount;
}
}

View File

@ -1,171 +0,0 @@
package hendrikschutter.com.externgnss;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbManager;
import android.util.Log;
import com.hoho.android.usbserial.driver.UsbSerialDriver;
import com.hoho.android.usbserial.driver.UsbSerialPort;
import com.hoho.android.usbserial.driver.UsbSerialProber;
import com.hoho.android.usbserial.util.SerialInputOutputManager;
import java.io.IOException;
import java.util.concurrent.BlockingQueue;
public class SerialUSB implements SerialInputOutputManager.Listener{
private MainActivity mainActivity = null;
private enum UsbPermission { Unknown, Requested, Granted, Denied }
private static final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB";
private int deviceId, portNum, baudRate;
private BroadcastReceiver broadcastReceiver = null;
private SerialInputOutputManager usbIoManager;
private UsbSerialPort usbSerialPort;
private UsbPermission usbPermission = UsbPermission.Unknown;
private BlockingQueue<Byte> dataBytesQueue = null;
private boolean connected = false;
private int deviceVendorId;
private int productID;
public SerialUSB(MainActivity mainActivity, BlockingQueue<Byte> dataBytesQueue){
this.mainActivity = mainActivity;
this.dataBytesQueue = dataBytesQueue;
}
public boolean isConnected(){
return connected;
}
public int getDeviceId(){
return this.deviceId;
}
public int getBaudRate(){
return this.baudRate;
}
public int getUsbDeviceVendorId(){
return this.deviceVendorId;
}
public boolean findSerialDevice(){
// Find all available drivers from attached devices.
UsbManager usbManager = (UsbManager) this.mainActivity.getSystemService(Context.USB_SERVICE);
UsbSerialProber usbDefaultProber = UsbSerialProber.getDefaultProber();
boolean deviceFound = false;
//check of at least one device is present
if (usbManager.getDeviceList().values().size() > 0){
//get fist device
UsbDevice device = (UsbDevice) usbManager.getDeviceList().values().toArray()[0];
UsbSerialDriver driver = usbDefaultProber.probeDevice(device);
if(driver == null) {
Log.e("SerialUSB", "driver is null");
}
if(driver != null) {
Log.i("SerialUSB", "ExternGNSS: device/driver found!");
this.deviceId = device.getDeviceId();
this.deviceVendorId = device.getVendorId();
deviceFound = true;
}
} else
{
Log.e("SerialUSB", "no serial device connected");
deviceFound = false;
}
return deviceFound;
}
public void connect(int baudRate, int portNum) {
this.baudRate = baudRate;
this.portNum = portNum;
Log.i("connect", "starting to connect ...");
UsbDevice device = null;
UsbManager usbManager = (UsbManager) this.mainActivity.getSystemService(Context.USB_SERVICE);
for(UsbDevice v : usbManager.getDeviceList().values())
if(v.getDeviceId() == deviceId)
device = v;
if(device == null) {
Log.i("connect", "connection failed: device not found");
return;
}
UsbSerialDriver driver = UsbSerialProber.getDefaultProber().probeDevice(device);
if(driver == null) {
Log.i("connect", "connection failed: no driver for device");
return;
}
if(driver.getPorts().size() < portNum) {
Log.i("connect", "connection failed: not enough ports at device");
return;
}
usbSerialPort = driver.getPorts().get(portNum);
UsbDeviceConnection usbConnection = null;
try {
usbConnection = usbManager.openDevice(driver.getDevice());
} catch (Exception e){
usbPermission = UsbPermission.Requested;
PendingIntent usbPermissionIntent = PendingIntent.getBroadcast(this.mainActivity, 0, new Intent(INTENT_ACTION_GRANT_USB), 0);
usbManager.requestPermission(driver.getDevice(), usbPermissionIntent);
}
usbConnection = usbManager.openDevice(driver.getDevice());
if(usbConnection == null && usbPermission == UsbPermission.Unknown && !usbManager.hasPermission(driver.getDevice())) {
usbPermission = UsbPermission.Requested;
PendingIntent usbPermissionIntent = PendingIntent.getBroadcast(this.mainActivity, 0, new Intent(INTENT_ACTION_GRANT_USB), 0);
usbManager.requestPermission(driver.getDevice(), usbPermissionIntent);
return;
}
if(usbConnection == null) {
if (!usbManager.hasPermission(driver.getDevice()))
Log.i("connect", "connection failed: permission denied");
else
Log.i("connect", "connection failed: open failed");
return;
}
try {
usbSerialPort.open(usbConnection);
usbSerialPort.setParameters(baudRate, 8, 1, UsbSerialPort.PARITY_NONE);
usbIoManager = new SerialInputOutputManager(usbSerialPort, this);
usbIoManager.start();
Log.i("connect", "connected");
connected = true;
} catch (Exception e) {
Log.i("connect", "connection failed: " + e.getMessage());
disconnect();
}
}
public void disconnect() {
connected = false;
if(usbIoManager != null) {
usbIoManager.setListener(null);
usbIoManager.stop();
}
usbIoManager = null;
try {
usbSerialPort.close();
} catch (IOException ignored) {}
usbSerialPort = null;
}
@Override
public void onNewData(byte[] data) {
//Log.i("connect", "received data: " + data.length);
//Log.i("connect", new String(data, StandardCharsets.US_ASCII) );
for (byte rawByte : data) {
this.dataBytesQueue.add(rawByte);
}
}
@Override
public void onRunError(Exception e) {
Log.e("SerialUSB", "runtime error: " + e.getMessage());
this.disconnect();
}
}

View File

@ -33,7 +33,7 @@
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginBottom="8dp" android:layout_marginLeft="16dp"
android:text="Altitude:" android:text="Altitude:"
android:textSize="18sp" android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="@+id/interngnssAltitudeNumber" app:layout_constraintBottom_toBottomOf="@+id/interngnssAltitudeNumber"
@ -47,7 +47,7 @@
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:clickable="false" android:clickable="false"
android:text="Intern GNSS receiver" android:text="Intern GNSS Receiver"
android:textAppearance="@style/TextAppearance.AppCompat.Large" android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -80,6 +80,7 @@
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="128dp" android:layout_marginStart="128dp"
android:layout_marginLeft="128dp"
android:clickable="false" android:clickable="false"
android:cursorVisible="false" android:cursorVisible="false"
android:ems="16" android:ems="16"
@ -88,14 +89,14 @@
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:textSize="16sp" android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/interngnssNameTextView" app:layout_constraintTop_toBottomOf="@+id/interngnssNameTextView" />
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
<EditText <EditText
android:id="@+id/interngnssLongNumber" android:id="@+id/interngnssLongNumber"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="128dp" android:layout_marginStart="128dp"
android:layout_marginLeft="128dp"
android:clickable="false" android:clickable="false"
android:cursorVisible="false" android:cursorVisible="false"
android:focusable="false" android:focusable="false"
@ -103,14 +104,14 @@
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:textSize="16sp" android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/interngnssLatNumber" app:layout_constraintTop_toBottomOf="@+id/interngnssLatNumber" />
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
<EditText <EditText
android:id="@+id/interngnssAltitudeNumber" android:id="@+id/interngnssAltitudeNumber"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="128dp" android:layout_marginStart="128dp"
android:layout_marginLeft="128dp"
android:clickable="false" android:clickable="false"
android:cursorVisible="false" android:cursorVisible="false"
android:focusable="false" android:focusable="false"
@ -118,14 +119,14 @@
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:textSize="16sp" android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/interngnssLongNumber" app:layout_constraintTop_toBottomOf="@+id/interngnssLongNumber" />
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
<EditText <EditText
android:id="@+id/interngnssAccuracyNumber" android:id="@+id/interngnssAccuracyNumber"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="128dp" android:layout_marginStart="128dp"
android:layout_marginLeft="128dp"
android:clickable="false" android:clickable="false"
android:cursorVisible="false" android:cursorVisible="false"
android:focusable="false" android:focusable="false"
@ -133,14 +134,14 @@
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:textSize="16sp" android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/interngnssAltitudeNumber" app:layout_constraintTop_toBottomOf="@+id/interngnssAltitudeNumber" />
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
<EditText <EditText
android:id="@+id/interngnssSatCountNumber" android:id="@+id/interngnssSatCountNumber"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="128dp" android:layout_marginStart="128dp"
android:layout_marginLeft="128dp"
android:clickable="false" android:clickable="false"
android:cursorVisible="false" android:cursorVisible="false"
android:focusable="false" android:focusable="false"
@ -148,152 +149,15 @@
android:inputType="number" android:inputType="number"
android:textSize="16sp" android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/interngnssAccuracyNumber" app:layout_constraintTop_toBottomOf="@+id/interngnssAccuracyNumber" />
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
<TextView <TextView
android:id="@+id/externgnssNameTextView" android:id="@+id/externGNSSTextView"
android:layout_width="wrap_content" android:layout_width="360dp"
android:layout_height="wrap_content" android:layout_height="347dp"
android:layout_marginStart="8dp" android:layout_marginStart="16dp"
android:layout_marginTop="272dp" android:layout_marginTop="300dp"
android:clickable="false"
android:text="Extern GNSS receiver"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/externgnssLongTextView"
android:layout_width="70dp"
android:layout_height="32dp"
android:layout_marginStart="16dp"
android:text="Long:"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="@+id/externgnssLongNumber"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/externgnssLatTextView"
android:layout_width="70dp"
android:layout_height="32dp"
android:layout_marginStart="16dp"
android:text="Lat:"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="@+id/externgnssLatNumber"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/externgnssSatCountTextView"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_marginStart="16dp"
android:text="Satellites:"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="@+id/externgnssSatCountNumber"
app:layout_constraintStart_toStartOf="parent" />
<EditText
android:id="@+id/externgnssLatNumber"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginStart="128dp"
android:clickable="false"
android:cursorVisible="false"
android:ems="16"
android:focusable="false"
android:focusableInTouchMode="false"
android:inputType="numberDecimal"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/externgnssNameTextView"
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck"
tools:text="no signal" />
<EditText
android:id="@+id/externgnssLongNumber"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginStart="128dp"
android:clickable="false"
android:cursorVisible="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:inputType="numberDecimal"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/externgnssLatNumber"
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck"
tools:text="no signal" />
<EditText
android:id="@+id/externgnssSatCountNumber"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginStart="128dp"
android:clickable="false"
android:cursorVisible="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:inputType="number"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/externgnssLongNumber"
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck"
tools:text="no signal" />
<TextView
android:id="@+id/diffGNSSNameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="450dp"
android:clickable="false"
android:text="GNSS difference"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/diffGNSSDistanceTextView"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_marginStart="20dp"
android:text="Distance:"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="@+id/diffGNSSDistanceNumber"
app:layout_constraintStart_toStartOf="parent" />
<EditText
android:id="@+id/diffGNSSDistanceNumber"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginStart="120dp"
android:layout_marginTop="184dp"
android:clickable="false"
android:cursorVisible="false"
android:ems="16"
android:focusable="false"
android:focusableInTouchMode="false"
android:inputType="numberDecimal"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/externgnssNameTextView"
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck"
tools:text="no signal" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floatingActionButtonExternGnssInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="23dp"
android:layout_marginBottom="45dp"
android:clickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@android:drawable/ic_dialog_info"
tools:ignore="SpeakableTextPresentCheck" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-device vendor-id="1027" product-id="24577"/> <!-- 0x6001: FT232R -->
</resources>

View File

@ -6,7 +6,8 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.1.3' classpath 'com.android.tools.build:gradle:7.1.2'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }