diff --git a/integrationapp/.gitignore b/integrationapp/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/integrationapp/.gitignore @@ -0,0 +1 @@ +/build diff --git a/integrationapp/build.gradle b/integrationapp/build.gradle new file mode 100644 index 0000000..bd452a7 --- /dev/null +++ b/integrationapp/build.gradle @@ -0,0 +1,39 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) + + defaultConfig { + applicationId "com.felhr.integrationapp" + minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION) + targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) + versionName project.VERSION_NAME + versionCode Integer.parseInt(project.VERSION_CODE) + } + + compileOptions { + encoding "UTF-8" + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation 'com.android.support:support-v4:23.1.1' + implementation 'com.android.support:appcompat-v7:23.1.1' + implementation 'com.android.support:design:23.1.1' + + implementation 'com.android.support:support-annotations:28.0.0' + + implementation 'com.android.support:support-annotations:28.0.0' + + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + androidTestImplementation 'junit:junit:4.12' + + testImplementation 'junit:junit:4.12' + + implementation 'com.squareup.okio:okio:2.1.0' + + implementation project(':usbserial') +} diff --git a/integrationapp/proguard-rules.pro b/integrationapp/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/integrationapp/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/integrationapp/src/androidTest/java/com/felhr/integrationapp/ExampleInstrumentedTest.java b/integrationapp/src/androidTest/java/com/felhr/integrationapp/ExampleInstrumentedTest.java new file mode 100644 index 0000000..671a7f1 --- /dev/null +++ b/integrationapp/src/androidTest/java/com/felhr/integrationapp/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.felhr.integrationapp; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.felhr.integrationapp", appContext.getPackageName()); + } +} diff --git a/integrationapp/src/main/AndroidManifest.xml b/integrationapp/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9455d46 --- /dev/null +++ b/integrationapp/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/integrationapp/src/main/java/com/felhr/integrationapp/MainActivity.java b/integrationapp/src/main/java/com/felhr/integrationapp/MainActivity.java new file mode 100644 index 0000000..05ff35b --- /dev/null +++ b/integrationapp/src/main/java/com/felhr/integrationapp/MainActivity.java @@ -0,0 +1,138 @@ +package com.felhr.integrationapp; + +import android.content.BroadcastReceiver; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.ServiceConnection; +import android.os.Bundle; +import android.os.Handler; +import android.os.IBinder; +import android.os.Message; +import android.support.v7.app.AppCompatActivity; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import java.lang.ref.WeakReference; +import java.util.Set; + +/** + * Created by Felipe Herranz(felhr85@gmail.com) on 24/02/2019. + */ +public class MainActivity extends AppCompatActivity { + + /* + * Notifications from UsbService will be received here. + */ + private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + switch (intent.getAction()) { + case UsbService.ACTION_USB_PERMISSION_GRANTED: // USB PERMISSION GRANTED + Toast.makeText(context, "USB Ready", Toast.LENGTH_SHORT).show(); + break; + case UsbService.ACTION_USB_PERMISSION_NOT_GRANTED: // USB PERMISSION NOT GRANTED + Toast.makeText(context, "USB Permission not granted", Toast.LENGTH_SHORT).show(); + break; + case UsbService.ACTION_NO_USB: // NO USB CONNECTED + Toast.makeText(context, "No USB connected", Toast.LENGTH_SHORT).show(); + break; + case UsbService.ACTION_USB_DISCONNECTED: // USB DISCONNECTED + Toast.makeText(context, "USB disconnected", Toast.LENGTH_SHORT).show(); + break; + case UsbService.ACTION_USB_NOT_SUPPORTED: // USB NOT SUPPORTED + Toast.makeText(context, "USB device not supported", Toast.LENGTH_SHORT).show(); + break; + } + } + }; + private UsbService usbService; + private TextView display1, display2; + private EditText editText1, editText2; + private Button button1, button2; + private MyHandler mHandler; + + private final ServiceConnection usbConnection = new ServiceConnection() { + @Override + public void onServiceConnected(ComponentName arg0, IBinder arg1) { + usbService = ((UsbService.UsbBinder) arg1).getService(); + usbService.setHandler(mHandler); + } + + @Override + public void onServiceDisconnected(ComponentName arg0) { + usbService = null; + } + }; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + //TODO!! + + mHandler = new MyHandler(this); + } + + @Override + public void onResume() { + super.onResume(); + setFilters(); // Start listening notifications from UsbService + startService(UsbService.class, usbConnection, null); // Start UsbService(if it was not started before) and Bind it + } + + @Override + public void onPause() { + super.onPause(); + unregisterReceiver(mUsbReceiver); + unbindService(usbConnection); + } + + private void startService(Class service, ServiceConnection serviceConnection, Bundle extras) { + if (!UsbService.SERVICE_CONNECTED) { + Intent startService = new Intent(this, service); + if (extras != null && !extras.isEmpty()) { + Set keys = extras.keySet(); + for (String key : keys) { + String extra = extras.getString(key); + startService.putExtra(key, extra); + } + } + startService(startService); + } + Intent bindingIntent = new Intent(this, service); + bindService(bindingIntent, serviceConnection, Context.BIND_AUTO_CREATE); + } + + private void setFilters() { + IntentFilter filter = new IntentFilter(); + filter.addAction(UsbService.ACTION_USB_PERMISSION_GRANTED); + filter.addAction(UsbService.ACTION_NO_USB); + filter.addAction(UsbService.ACTION_USB_DISCONNECTED); + filter.addAction(UsbService.ACTION_USB_NOT_SUPPORTED); + filter.addAction(UsbService.ACTION_USB_PERMISSION_NOT_GRANTED); + registerReceiver(mUsbReceiver, filter); + } + + /* + * This handler will be passed to UsbService. Data received from serial port is displayed through this handler + */ + private static class MyHandler extends Handler { + private final WeakReference mActivity; + + public MyHandler(MainActivity activity) { + mActivity = new WeakReference<>(activity); + } + + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + //TODO!! + } + } + } +} diff --git a/integrationapp/src/main/java/com/felhr/integrationapp/UsbService.java b/integrationapp/src/main/java/com/felhr/integrationapp/UsbService.java new file mode 100644 index 0000000..770f128 --- /dev/null +++ b/integrationapp/src/main/java/com/felhr/integrationapp/UsbService.java @@ -0,0 +1,331 @@ +package com.felhr.integrationapp; + +import android.app.PendingIntent; +import android.app.Service; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.hardware.usb.UsbDevice; +import android.hardware.usb.UsbDeviceConnection; +import android.hardware.usb.UsbManager; +import android.os.Binder; +import android.os.Handler; +import android.os.IBinder; +import android.util.Log; + +import com.felhr.usbserial.CDCSerialDevice; +import com.felhr.usbserial.UsbSerialDevice; +import com.felhr.usbserial.UsbSerialInterface; + +import java.util.HashMap; +import java.util.Map; + +import okio.Buffer; + +public class UsbService extends Service { + + public static final String TAG = "UsbService"; + + private static final int SIZE_TEST_1 = 1024; + private static final int SIZE_TEST_2 = 2048; + private static final int SIZE_TEST_3 = 16384; + private static final int SIZE_TEST_4 = 65535; + private static final int SIZE_TEST_5 = 131072; + + private static final String TEST_1 = "test1"; + private static final String TEST_2 = "test2"; + private static final String TEST_3 = "test3"; + private static final String TEST_4 = "test4"; + private static final String TEST_5 = "test5"; + + + public static final String ACTION_USB_READY = "com.felhr.connectivityservices.USB_READY"; + public static final String ACTION_USB_ATTACHED = "android.hardware.usb.action.USB_DEVICE_ATTACHED"; + public static final String ACTION_USB_DETACHED = "android.hardware.usb.action.USB_DEVICE_DETACHED"; + public static final String ACTION_USB_NOT_SUPPORTED = "com.felhr.usbservice.USB_NOT_SUPPORTED"; + public static final String ACTION_NO_USB = "com.felhr.usbservice.NO_USB"; + public static final String ACTION_USB_PERMISSION_GRANTED = "com.felhr.usbservice.USB_PERMISSION_GRANTED"; + public static final String ACTION_USB_PERMISSION_NOT_GRANTED = "com.felhr.usbservice.USB_PERMISSION_NOT_GRANTED"; + public static final String ACTION_USB_DISCONNECTED = "com.felhr.usbservice.USB_DISCONNECTED"; + public static final String ACTION_CDC_DRIVER_NOT_WORKING = "com.felhr.connectivityservices.ACTION_CDC_DRIVER_NOT_WORKING"; + public static final String ACTION_USB_DEVICE_NOT_WORKING = "com.felhr.connectivityservices.ACTION_USB_DEVICE_NOT_WORKING"; + public static final int MESSAGE_FROM_SERIAL_PORT = 0; + public static final int CTS_CHANGE = 1; + public static final int DSR_CHANGE = 2; + private static final String ACTION_USB_PERMISSION = "com.android.example.USB_PERMISSION"; + private static final int BAUD_RATE = 9600; // BaudRate. Change this value if you need + public static boolean SERVICE_CONNECTED = false; + + private IBinder binder = new UsbBinder(); + + private Context context; + private Handler mHandler; + private UsbManager usbManager; + private UsbDevice device; + private UsbDeviceConnection connection; + private UsbSerialDevice serialPort; + + private Buffer buffer = new Buffer(); + private String mode; + + private boolean serialPortConnected; + + + private UsbSerialInterface.UsbReadCallback mCallback = new UsbSerialInterface.UsbReadCallback() { + @Override + public void onReceivedData(byte[] arg0) { + buffer.write(arg0); + if(mode.equals(TEST_1)){ + if(buffer.size() == SIZE_TEST_1){ + serialPort.write(buffer.readByteArray()); + mode = TEST_2; + mHandler.obtainMessage(MESSAGE_FROM_SERIAL_PORT, "Test 1Kb completed correctly").sendToTarget(); + } + }else if(mode.equals(TEST_2)){ + if(buffer.size() == SIZE_TEST_2){ + serialPort.write(buffer.readByteArray()); + mode = TEST_3; + mHandler.obtainMessage(MESSAGE_FROM_SERIAL_PORT, "Test 3Kb completed correctly").sendToTarget(); + } + + }else if(mode.equals(TEST_3)){ + if(buffer.size() == SIZE_TEST_3){ + serialPort.write(buffer.readByteArray()); + mode = TEST_4; + mHandler.obtainMessage(MESSAGE_FROM_SERIAL_PORT, "Test 16Kb completed correctly").sendToTarget(); + } + }else if(mode.equals(TEST_4)){ + if(buffer.size() == SIZE_TEST_4){ + serialPort.write(buffer.readByteArray()); + mode = TEST_5; + mHandler.obtainMessage(MESSAGE_FROM_SERIAL_PORT, "Test 64Kb completed correctly").sendToTarget(); + } + }else if(mode.equals(TEST_5)){ + if(buffer.size() == SIZE_TEST_5){ + serialPort.write(buffer.readByteArray()); + mode = TEST_1; + mHandler.obtainMessage(MESSAGE_FROM_SERIAL_PORT, "Test 128Kb completed correctly").sendToTarget(); + } + } + } + }; + + /* + * State changes in the CTS line will be received here + */ + private UsbSerialInterface.UsbCTSCallback ctsCallback = new UsbSerialInterface.UsbCTSCallback() { + @Override + public void onCTSChanged(boolean state) { + if(mHandler != null) + mHandler.obtainMessage(CTS_CHANGE).sendToTarget(); + } + }; + + /* + * State changes in the DSR line will be received here + */ + private UsbSerialInterface.UsbDSRCallback dsrCallback = new UsbSerialInterface.UsbDSRCallback() { + @Override + public void onDSRChanged(boolean state) { + if(mHandler != null) + mHandler.obtainMessage(DSR_CHANGE).sendToTarget(); + } + }; + /* + * Different notifications from OS will be received here (USB attached, detached, permission responses...) + * About BroadcastReceiver: http://developer.android.com/reference/android/content/BroadcastReceiver.html + */ + private final BroadcastReceiver usbReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context arg0, Intent arg1) { + if (arg1.getAction().equals(ACTION_USB_PERMISSION)) { + boolean granted = arg1.getExtras().getBoolean(UsbManager.EXTRA_PERMISSION_GRANTED); + if (granted) // User accepted our USB connection. Try to open the device as a serial port + { + Intent intent = new Intent(ACTION_USB_PERMISSION_GRANTED); + arg0.sendBroadcast(intent); + connection = usbManager.openDevice(device); + new ConnectionThread().start(); + } else // User not accepted our USB connection. Send an Intent to the Main Activity + { + Intent intent = new Intent(ACTION_USB_PERMISSION_NOT_GRANTED); + arg0.sendBroadcast(intent); + } + } else if (arg1.getAction().equals(ACTION_USB_ATTACHED)) { + if (!serialPortConnected) + findSerialPortDevice(); // A USB device has been attached. Try to open it as a Serial port + } else if (arg1.getAction().equals(ACTION_USB_DETACHED)) { + // Usb device was disconnected. send an intent to the Main Activity + Intent intent = new Intent(ACTION_USB_DISCONNECTED); + arg0.sendBroadcast(intent); + if (serialPortConnected) { + serialPort.close(); + } + serialPortConnected = false; + } + } + }; + + /* + * onCreate will be executed when service is started. It configures an IntentFilter to listen for + * incoming Intents (USB ATTACHED, USB DETACHED...) and it tries to open a serial port. + */ + @Override + public void onCreate() { + this.context = this; + serialPortConnected = false; + UsbService.SERVICE_CONNECTED = true; + setFilter(); + usbManager = (UsbManager) getSystemService(Context.USB_SERVICE); + findSerialPortDevice(); + mode = TEST_1; + } + + /* MUST READ about services + * http://developer.android.com/guide/components/services.html + * http://developer.android.com/guide/components/bound-services.html + */ + @Override + public IBinder onBind(Intent intent) { + return binder; + } + + @Override + public int onStartCommand(Intent intent, int flags, int startId) { + return Service.START_NOT_STICKY; + } + + @Override + public void onDestroy() { + super.onDestroy(); + serialPort.close(); + unregisterReceiver(usbReceiver); + UsbService.SERVICE_CONNECTED = false; + } + + + public void setHandler(Handler mHandler) { + this.mHandler = mHandler; + } + + private void findSerialPortDevice() { + // This snippet will try to open the first encountered usb device connected, excluding usb root hubs + HashMap usbDevices = usbManager.getDeviceList(); + if (!usbDevices.isEmpty()) { + + // first, dump the hashmap for diagnostic purposes + for (Map.Entry entry : usbDevices.entrySet()) { + device = entry.getValue(); + Log.d(TAG, String.format("USBDevice.HashMap (vid:pid) (%X:%X)-%b class:%X:%X name:%s", + device.getVendorId(), device.getProductId(), + UsbSerialDevice.isSupported(device), + device.getDeviceClass(), device.getDeviceSubclass(), + device.getDeviceName())); + } + + for (Map.Entry entry : usbDevices.entrySet()) { + device = entry.getValue(); + int deviceVID = device.getVendorId(); + int devicePID = device.getProductId(); + +// if (deviceVID != 0x1d6b && (devicePID != 0x0001 && devicePID != 0x0002 && devicePID != 0x0003) && deviceVID != 0x5c6 && devicePID != 0x904c) { + if (UsbSerialDevice.isSupported(device)) { + // There is a supported device connected - request permission to access it. + requestUserPermission(); + break; + } else { + connection = null; + device = null; + } + } + if (device==null) { + // There are no USB devices connected (but usb host were listed). Send an intent to MainActivity. + Intent intent = new Intent(ACTION_NO_USB); + sendBroadcast(intent); + } + } else { + Log.d(TAG, "findSerialPortDevice() usbManager returned empty device list." ); + // There is no USB devices connected. Send an intent to MainActivity + Intent intent = new Intent(ACTION_NO_USB); + sendBroadcast(intent); + } + } + + private void setFilter() { + IntentFilter filter = new IntentFilter(); + filter.addAction(ACTION_USB_PERMISSION); + filter.addAction(ACTION_USB_DETACHED); + filter.addAction(ACTION_USB_ATTACHED); + registerReceiver(usbReceiver, filter); + } + + /* + * Request user permission. The response will be received in the BroadcastReceiver + */ + private void requestUserPermission() { + Log.d(TAG, String.format("requestUserPermission(%X:%X)", device.getVendorId(), device.getProductId() ) ); + PendingIntent mPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0); + usbManager.requestPermission(device, mPendingIntent); + } + + public class UsbBinder extends Binder { + public UsbService getService() { + return UsbService.this; + } + } + + /* + * A simple thread to open a serial port. + * Although it should be a fast operation. moving usb operations away from UI thread is a good thing. + */ + private class ConnectionThread extends Thread { + @Override + public void run() { + serialPort = UsbSerialDevice.createUsbSerialDevice(device, connection); + if (serialPort != null) { + if (serialPort.open()) { + serialPortConnected = true; + serialPort.setBaudRate(BAUD_RATE); + serialPort.setDataBits(UsbSerialInterface.DATA_BITS_8); + serialPort.setStopBits(UsbSerialInterface.STOP_BITS_1); + serialPort.setParity(UsbSerialInterface.PARITY_NONE); + /** + * Current flow control Options: + * UsbSerialInterface.FLOW_CONTROL_OFF + * UsbSerialInterface.FLOW_CONTROL_RTS_CTS only for CP2102 and FT232 + * UsbSerialInterface.FLOW_CONTROL_DSR_DTR only for CP2102 and FT232 + */ + serialPort.setFlowControl(UsbSerialInterface.FLOW_CONTROL_OFF); + serialPort.read(mCallback); + serialPort.getCTS(ctsCallback); + serialPort.getDSR(dsrCallback); + + // + // Some Arduinos would need some sleep because firmware wait some time to know whether a new sketch is going + // to be uploaded or not + //Thread.sleep(2000); // sleep some. YMMV with different chips. + + // Everything went as expected. Send an intent to MainActivity + Intent intent = new Intent(ACTION_USB_READY); + context.sendBroadcast(intent); + } else { + // Serial port could not be opened, maybe an I/O error or if CDC driver was chosen, it does not really fit + // Send an Intent to Main Activity + if (serialPort instanceof CDCSerialDevice) { + Intent intent = new Intent(ACTION_CDC_DRIVER_NOT_WORKING); + context.sendBroadcast(intent); + } else { + Intent intent = new Intent(ACTION_USB_DEVICE_NOT_WORKING); + context.sendBroadcast(intent); + } + } + } else { + // No driver for given device, even generic CDC driver could not be loaded + Intent intent = new Intent(ACTION_USB_NOT_SUPPORTED); + context.sendBroadcast(intent); + } + } + } +} + diff --git a/integrationapp/src/main/res/drawable-v24/ic_launcher_foreground.xml b/integrationapp/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..3bb4cdb --- /dev/null +++ b/integrationapp/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/integrationapp/src/main/res/drawable/ic_launcher_background.xml b/integrationapp/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..e80b3ee --- /dev/null +++ b/integrationapp/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/integrationapp/src/main/res/layout/activity_main.xml b/integrationapp/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..fb3d8a2 --- /dev/null +++ b/integrationapp/src/main/res/layout/activity_main.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/integrationapp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/integrationapp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..bbd3e02 --- /dev/null +++ b/integrationapp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/integrationapp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/integrationapp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..bbd3e02 --- /dev/null +++ b/integrationapp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/integrationapp/src/main/res/mipmap-hdpi/ic_launcher.png b/integrationapp/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..898f3ed Binary files /dev/null and b/integrationapp/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/integrationapp/src/main/res/mipmap-hdpi/ic_launcher_round.png b/integrationapp/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..dffca36 Binary files /dev/null and b/integrationapp/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/integrationapp/src/main/res/mipmap-mdpi/ic_launcher.png b/integrationapp/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..64ba76f Binary files /dev/null and b/integrationapp/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/integrationapp/src/main/res/mipmap-mdpi/ic_launcher_round.png b/integrationapp/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..dae5e08 Binary files /dev/null and b/integrationapp/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/integrationapp/src/main/res/mipmap-xhdpi/ic_launcher.png b/integrationapp/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..e5ed465 Binary files /dev/null and b/integrationapp/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/integrationapp/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/integrationapp/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..14ed0af Binary files /dev/null and b/integrationapp/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/integrationapp/src/main/res/mipmap-xxhdpi/ic_launcher.png b/integrationapp/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..b0907ca Binary files /dev/null and b/integrationapp/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/integrationapp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/integrationapp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..d8ae031 Binary files /dev/null and b/integrationapp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/integrationapp/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/integrationapp/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..2c18de9 Binary files /dev/null and b/integrationapp/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/integrationapp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/integrationapp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..beed3cd Binary files /dev/null and b/integrationapp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/integrationapp/src/main/res/values/colors.xml b/integrationapp/src/main/res/values/colors.xml new file mode 100644 index 0000000..69b2233 --- /dev/null +++ b/integrationapp/src/main/res/values/colors.xml @@ -0,0 +1,6 @@ + + + #008577 + #00574B + #D81B60 + diff --git a/integrationapp/src/main/res/values/strings.xml b/integrationapp/src/main/res/values/strings.xml new file mode 100644 index 0000000..b344863 --- /dev/null +++ b/integrationapp/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + IntegrationApp + diff --git a/integrationapp/src/main/res/values/styles.xml b/integrationapp/src/main/res/values/styles.xml new file mode 100644 index 0000000..5885930 --- /dev/null +++ b/integrationapp/src/main/res/values/styles.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/integrationapp/src/test/java/com/felhr/integrationapp/ExampleUnitTest.java b/integrationapp/src/test/java/com/felhr/integrationapp/ExampleUnitTest.java new file mode 100644 index 0000000..e7b9478 --- /dev/null +++ b/integrationapp/src/test/java/com/felhr/integrationapp/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.felhr.integrationapp; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 01990f1..a419cbe 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':usbserial', ':example', ':examplesync', ':examplestreams', ':examplemultipleports' \ No newline at end of file +include ':usbserial', ':example', ':examplesync', ':examplestreams', ':examplemultipleports', ':integrationapp' \ No newline at end of file