Skip to content

Commit

Permalink
Merge pull request #18 from cslrfid/release-2.0.0
Browse files Browse the repository at this point in the history
Updates for Google Play privacy policy requirement on location
  • Loading branch information
ksclam authored Jul 6, 2021
2 parents dc0486c + f9a29ee commit d397ec2
Show file tree
Hide file tree
Showing 56 changed files with 6,616 additions and 2,334 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
compileSdkVersion 30
defaultConfig {
applicationId "com.csl.cs108ademoapp"
minSdkVersion 19
targetSdkVersion 29
versionCode 29
versionName "1.24.0"
targetSdkVersion 30
versionCode 30
versionName "2.0.0"
}
}

Expand Down
Binary file removed app/release/app-release.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 29,
"versionName": "1.24.0",
"versionCode": 30,
"versionName": "2.0.0",
"outputFile": "app-release.apk"
}
]
Expand Down
20 changes: 0 additions & 20 deletions app/release/output.json

This file was deleted.

5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
android:icon="@drawable/csl_logo"
android:label="@string/app_name"
android:supportsRtl="true"
android:requestLegacyExternalStorage="true"
android:theme="@style/AppTheme">

<service android:name=".CustomIME"
<service android:name="com.csl.cs108ademoapp.CustomIME"
android:label="@string/app_ime"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
Expand All @@ -25,7 +26,7 @@
</service>

<activity
android:name=".MainActivity"
android:name="com.csl.cs108ademoapp.MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/csl/cs108ademoapp/AccessTask1.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.os.AsyncTask;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.csl.cs108library4a.Cs108Connector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import android.content.res.AssetFileDescriptor;
import android.media.AudioManager;
import android.media.MediaPlayer;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.widget.TextView;

import static android.content.Context.LAYOUT_INFLATER_SERVICE;
import static com.csl.cs108ademoapp.MainActivity.mCs108Library4a;

public class CustomPopupWindow {
Context context;
Expand All @@ -26,6 +27,7 @@ public void popupStart(String message, boolean wait) {
TextView textViewDismiss = (TextView)popupView.findViewById(R.id.dismissMessage);
int iLenghtMax = 300;
if (message.length() > iLenghtMax) message = message.substring(0, iLenghtMax) + " .....";
mCs108Library4a.appendToLog("SaveList2ExternalTask: popupStart message = " + message);
textViewDismiss.setText(message);
Button btnDismiss = (Button)popupView.findViewById(R.id.dismiss);
if (wait) btnDismiss.setVisibility(View.GONE);
Expand Down
22 changes: 15 additions & 7 deletions app/src/main/java/com/csl/cs108ademoapp/InventoryRfidTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,17 +262,17 @@ void inventoryHandler_tag() {
int extraLength = 0;
if (extra1Bank != -1 && rx000pkgData.decodedData1 != null) extraLength += rx000pkgData.decodedData1.length;
if (extra2Bank != -1 && rx000pkgData.decodedData2 != null) extraLength += rx000pkgData.decodedData2.length;
if (extraLength != 0) {
if (extraLength != 0 && MainActivity.mCs108Library4a.getcsModel() != 710) {
byte[] decodedEpcNew = new byte[rx000pkgData.decodedEpc.length - extraLength];
System.arraycopy(rx000pkgData.decodedEpc, 0, decodedEpcNew, 0, decodedEpcNew.length);
rx000pkgData.decodedEpc = decodedEpcNew;
}
String strEpc = MainActivity.mCs108Library4a.byteArrayToString(rx000pkgData.decodedEpc);
MainActivity.mCs108Library4a.appendToLog("HelloC: decodePc = " + strPc + ", decodedEpc = " + strEpc + ", iFlags = " + String.format("%2X", iFlag));
if (false) MainActivity.mCs108Library4a.appendToLog("HelloC: decodePc = " + strPc + ", decodedEpc = " + strEpc + ", iFlags = " + String.format("%2X", iFlag));
portstatus = INVALID_CODEVALUE; backport1 = INVALID_CODEVALUE; backport2 = INVALID_CODEVALUE; codeSensor = INVALID_CODEVALUE; codeRssi = INVALID_CODEVALUE; codeTempC = INVALID_CODEVALUE; brand = null;
String strExtra2 = null; if (rx000pkgData.decodedData2 != null) strExtra2 = MainActivity.mCs108Library4a.byteArrayToString(rx000pkgData.decodedData2);
if (strExtra2 != null && strMdid != null) {
MainActivity.mCs108Library4a.appendToLog("HelloK: strExtra2 = " + strExtra2 + ", strMdid = " + strMdid);
if (false) MainActivity.mCs108Library4a.appendToLog("HelloK: strExtra2 = " + strExtra2 + ", strMdid = " + strMdid);
if (strMdid.contains("E200B0")) portstatus = Integer.parseInt(strExtra2.substring(3, 4), 16);
}
String strExtra1 = null; if (rx000pkgData.decodedData1 != null) {
Expand Down Expand Up @@ -499,13 +499,21 @@ void inventoryHandler_tag() {
stringTemp += "\nE" + String.valueOf(MainActivity.mCs108Library4a.invalidata) + "," + String.valueOf(MainActivity.mCs108Library4a.invalidUpdata) + "/" + String.valueOf(MainActivity.mCs108Library4a.validata);
}
if (rfidYieldView != null) rfidYieldView.setText(stringTemp);
if (total != 0) {
if (total != 0 && currentTime - firstTimeOld > 500) {
if (firstTimeOld == 0) firstTimeOld = firstTime;
if (totalOld == 0) totalOld = total;
String strRate = "Total:" + String.valueOf(allTotal) + "\n";
if (lastTime == 0) {
strRate += "Rate:" + String.valueOf(yieldRate) + "/" + String.valueOf(MainActivity.mCs108Library4a.getStreamInRate() / 17);
} else if (currentTime > firstTimeOld) strRate += "Rate:" + String.valueOf(yieldRate) + "/" + String.valueOf(totalOld * 1000 / (currentTime - firstTimeOld));
long tagRate = MainActivity.mCs108Library4a.getTagRate();
if (tagRate >= 0) {
strRate += "raTe";
} else if (lastTime == 0) {
tagRate = MainActivity.mCs108Library4a.getStreamInRate() / 17;
strRate += "rAte";
} else if (currentTime > firstTimeOld) {
tagRate = totalOld * 1000 / (currentTime - firstTimeOld);
strRate += "Rate";
}
strRate += ":" + String.valueOf(yieldRate) + "/" + String.valueOf(tagRate);
if (rfidRateView != null) rfidRateView.setText(strRate);
//if (lastTime - firstTime > 1000) {
firstTimeOld = currentTime;
Expand Down
143 changes: 0 additions & 143 deletions app/src/main/java/com/csl/cs108ademoapp/InventoryRfidTask0.java

This file was deleted.

38 changes: 37 additions & 1 deletion app/src/main/java/com/csl/cs108ademoapp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.nfc.NdefMessage;
import android.nfc.NfcAdapter;
import android.os.Handler;
Expand Down Expand Up @@ -277,7 +278,7 @@ private void selectItem(DrawerPositions position) {
} else {
//Pop the back stack since we want to maintain only one level of the back stack
//Add the transaction to the back stack since we want the state to be preserved in the back stack
fragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
//fragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
fragmentManager.beginTransaction().replace(R.id.content_frame, fragment, TAG_CONTENT_FRAGMENT).addToBackStack(null).commit();
}
mDrawerLayout.closeDrawer(mDrawerList);
Expand All @@ -293,6 +294,7 @@ public void setTitle(CharSequence title) {
public void onBackPressed() {
mDrawerList.setItemChecked(0, true);
Fragment fragment = getSupportFragmentManager().findFragmentByTag(TAG_CONTENT_FRAGMENT);
MainActivity.mCs108Library4a.appendToLog("MainActivity super.onBackPressed");
super.onBackPressed();
}

Expand All @@ -309,7 +311,41 @@ public void sfnClicked(View view) {
selectItem(DrawerPositions.SPECIAL);
}

public void privacyClicked(View view) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse("https://www.convergence.com.hk/apps-privacy-policy"));
startActivity(intent);
}
public void aboutClicked(View view) {
// MainActivity.mCs108Library4a.macRead(8);

// MainActivity.mCs108Library4a.setRfidOn(false);

// MainActivity.mCs108Library4a.barcodeSendCommandTrigger();
// MainActivity.mCs108Library4a.setVibrateOn(1);
// MainActivity.mCs108Library4a.barcodeReadTriggerStart();
// MainActivity.mCs108Library4a.setBarcodeOn(false);

// MainActivity.mCs108Library4a.getAutoBarStartSTop();
// MainActivity.mCs108Library4a.setAutoBarStartSTop(false);
// MainActivity.mCs108Library4a.getAutoRFIDAbort();
// MainActivity.mCs108Library4a.setAutoRFIDAbort(false);
// MainActivity.mCs108Library4a.setBatteryAutoReport(true);
// MainActivity.mCs108Library4a.triggerButtoneStatusRequest();
// MainActivity.mCs108Library4a.batteryLevelRequest();

// MainActivity.mCs108Library4a.resetSiliconLab();
// MainActivity.mCs108Library4a.getModelName();
// MainActivity.mCs108Library4a.getHostProcessorICSerialNumber();
// MainActivity.mCs108Library4a.hostProcessorICGetFirmwareVersion();

// MainActivity.mCs108Library4a.forceBTdisconnect();
// MainActivity.mCs108Library4a.getBluetoothICFirmwareName();
// MainActivity.mCs108Library4a.setBluetoothICFirmwareName("CS109 Reader TT");
// MainActivity.mCs108Library4a.getBluetoothICFirmwareVersion();

selectItem(DrawerPositions.ABOUT);
}
public void connectClicked(View view) {
Expand Down
Loading

0 comments on commit d397ec2

Please sign in to comment.