Initial Comit

This commit is contained in:
2021-12-19 10:56:25 +01:00
commit b8c9c75cf8
2351 changed files with 1819654 additions and 0 deletions

Binary file not shown.

Binary file not shown.

68
Archiv/DPMMobile.b4a Normal file
View File

@@ -0,0 +1,68 @@
Build1=Default,b4a.example
File1=Application.bal
FileGroup1=Default Group
Group=Default Group
IconFile=
Library1=core
Library2=abzxing
ManifestCode='This code will be applied to the manifest file during compilation.~\n~'You do not need to modify it in most cases.~\n~'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136~\n~AddManifestText(~\n~<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>~\n~<supports-screens android:largeScreens="true" ~\n~ android:normalScreens="true" ~\n~ android:smallScreens="true" ~\n~ android:anyDensity="true"/>)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~CreateResourceFromFile(Macro, Themes.DarkTheme)~\n~'End of default text.~\n~
Module1=Starter
NumberOfFiles=1
NumberOfLibraries=2
NumberOfModules=1
Version=8.8
@EndOfDesignText@
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim myABBarcode As ABZxing
Private Label1 As Label
Private Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("Application")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
myABBarcode.ABGetBarcode("myabbarcode", "")
End Sub
Sub myABBarcode_BarcodeFound(barCode As String, formatName As String)
Label1.Text=barCode
End Sub
Sub myABBarcode_Canceled
msgbox("Canceled","")
End Sub

View File

@@ -0,0 +1,8 @@
ModuleBookmarks0=
ModuleBookmarks1=
ModuleBreakpoints0=
ModuleBreakpoints1=
ModuleClosedNodes0=1,2
ModuleClosedNodes1=1
SelectedBuild=0
VisibleModules=1

Binary file not shown.

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="b4a.example"
android:versionCode="1"
android:versionName=""
android:installLocation="internalOnly">
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<application
android:icon="@drawable/icon"
android:label="B4A Example"
android:theme="@style/DarkTheme">
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".main"
android:label="B4A Example"
android:screenOrientation="unspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".starter">
</service>
<receiver android:name=".starter$starter_BR">
</receiver>
</application>
</manifest>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Archiv/Objects/bin/temp.ap_ Normal file

Binary file not shown.

BIN
Archiv/Objects/classes.dex Normal file

Binary file not shown.

View File

@@ -0,0 +1,19 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package b4a.example;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class style {
public static final int DarkTheme=0x7f030000;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style
name="DarkTheme" parent="@android:style/Theme.Holo">
</style>
</resources>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style
name="DarkTheme" parent="@android:style/Theme.Material">
</style>
</resources>

View File

@@ -0,0 +1,15 @@
package b4a.example.designerscripts;
import anywheresoftware.b4a.objects.TextViewWrapper;
import anywheresoftware.b4a.objects.ImageViewWrapper;
import anywheresoftware.b4a.BA;
public class LS_application{
public static void LS_general(java.util.LinkedHashMap<String, anywheresoftware.b4a.keywords.LayoutBuilder.ViewWrapperAndAnchor> views, int width, int height, float scale) {
anywheresoftware.b4a.keywords.LayoutBuilder.setScaleRate(0.3);
//BA.debugLineNum = 2;BA.debugLine="AutoScaleAll"[Application/General script]
anywheresoftware.b4a.keywords.LayoutBuilder.scaleAll(views);
}
}

View File

@@ -0,0 +1,408 @@
package b4a.example;
import anywheresoftware.b4a.B4AMenuItem;
import android.app.Activity;
import android.os.Bundle;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.B4AActivity;
import anywheresoftware.b4a.ObjectWrapper;
import anywheresoftware.b4a.objects.ActivityWrapper;
import java.lang.reflect.InvocationTargetException;
import anywheresoftware.b4a.B4AUncaughtException;
import anywheresoftware.b4a.debug.*;
import java.lang.ref.WeakReference;
public class main extends Activity implements B4AActivity{
public static main mostCurrent;
static boolean afterFirstLayout;
static boolean isFirst = true;
private static boolean processGlobalsRun = false;
BALayout layout;
public static BA processBA;
BA activityBA;
ActivityWrapper _activity;
java.util.ArrayList<B4AMenuItem> menuItems;
public static final boolean fullScreen = false;
public static final boolean includeTitle = true;
public static WeakReference<Activity> previousOne;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mostCurrent = this;
if (processBA == null) {
processBA = new BA(this.getApplicationContext(), null, null, "b4a.example", "b4a.example.main");
processBA.loadHtSubs(this.getClass());
float deviceScale = getApplicationContext().getResources().getDisplayMetrics().density;
BALayout.setDeviceScale(deviceScale);
}
else if (previousOne != null) {
Activity p = previousOne.get();
if (p != null && p != this) {
BA.LogInfo("Killing previous instance (main).");
p.finish();
}
}
processBA.setActivityPaused(true);
processBA.runHook("oncreate", this, null);
if (!includeTitle) {
this.getWindow().requestFeature(android.view.Window.FEATURE_NO_TITLE);
}
if (fullScreen) {
getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,
android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
processBA.sharedProcessBA.activityBA = null;
layout = new BALayout(this);
setContentView(layout);
afterFirstLayout = false;
WaitForLayout wl = new WaitForLayout();
if (anywheresoftware.b4a.objects.ServiceHelper.StarterHelper.startFromActivity(processBA, wl, false))
BA.handler.postDelayed(wl, 5);
}
static class WaitForLayout implements Runnable {
public void run() {
if (afterFirstLayout)
return;
if (mostCurrent == null)
return;
if (mostCurrent.layout.getWidth() == 0) {
BA.handler.postDelayed(this, 5);
return;
}
mostCurrent.layout.getLayoutParams().height = mostCurrent.layout.getHeight();
mostCurrent.layout.getLayoutParams().width = mostCurrent.layout.getWidth();
afterFirstLayout = true;
mostCurrent.afterFirstLayout();
}
}
private void afterFirstLayout() {
if (this != mostCurrent)
return;
activityBA = new BA(this, layout, processBA, "b4a.example", "b4a.example.main");
processBA.sharedProcessBA.activityBA = new java.lang.ref.WeakReference<BA>(activityBA);
anywheresoftware.b4a.objects.ViewWrapper.lastId = 0;
_activity = new ActivityWrapper(activityBA, "activity");
anywheresoftware.b4a.Msgbox.isDismissing = false;
if (BA.isShellModeRuntimeCheck(processBA)) {
if (isFirst)
processBA.raiseEvent2(null, true, "SHELL", false);
processBA.raiseEvent2(null, true, "CREATE", true, "b4a.example.main", processBA, activityBA, _activity, anywheresoftware.b4a.keywords.Common.Density, mostCurrent);
_activity.reinitializeForShell(activityBA, "activity");
}
initializeProcessGlobals();
initializeGlobals();
BA.LogInfo("** Activity (main) Create, isFirst = " + isFirst + " **");
processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
isFirst = false;
if (this != mostCurrent)
return;
processBA.setActivityPaused(false);
BA.LogInfo("** Activity (main) Resume **");
processBA.raiseEvent(null, "activity_resume");
if (android.os.Build.VERSION.SDK_INT >= 11) {
try {
android.app.Activity.class.getMethod("invalidateOptionsMenu").invoke(this,(Object[]) null);
} catch (Exception e) {
e.printStackTrace();
}
}
}
public void addMenuItem(B4AMenuItem item) {
if (menuItems == null)
menuItems = new java.util.ArrayList<B4AMenuItem>();
menuItems.add(item);
}
@Override
public boolean onCreateOptionsMenu(android.view.Menu menu) {
super.onCreateOptionsMenu(menu);
try {
if (processBA.subExists("activity_actionbarhomeclick")) {
Class.forName("android.app.ActionBar").getMethod("setHomeButtonEnabled", boolean.class).invoke(
getClass().getMethod("getActionBar").invoke(this), true);
}
} catch (Exception e) {
e.printStackTrace();
}
if (processBA.runHook("oncreateoptionsmenu", this, new Object[] {menu}))
return true;
if (menuItems == null)
return false;
for (B4AMenuItem bmi : menuItems) {
android.view.MenuItem mi = menu.add(bmi.title);
if (bmi.drawable != null)
mi.setIcon(bmi.drawable);
if (android.os.Build.VERSION.SDK_INT >= 11) {
try {
if (bmi.addToBar) {
android.view.MenuItem.class.getMethod("setShowAsAction", int.class).invoke(mi, 1);
}
} catch (Exception e) {
e.printStackTrace();
}
}
mi.setOnMenuItemClickListener(new B4AMenuItemsClickListener(bmi.eventName.toLowerCase(BA.cul)));
}
return true;
}
@Override
public boolean onOptionsItemSelected(android.view.MenuItem item) {
if (item.getItemId() == 16908332) {
processBA.raiseEvent(null, "activity_actionbarhomeclick");
return true;
}
else
return super.onOptionsItemSelected(item);
}
@Override
public boolean onPrepareOptionsMenu(android.view.Menu menu) {
super.onPrepareOptionsMenu(menu);
processBA.runHook("onprepareoptionsmenu", this, new Object[] {menu});
return true;
}
protected void onStart() {
super.onStart();
processBA.runHook("onstart", this, null);
}
protected void onStop() {
super.onStop();
processBA.runHook("onstop", this, null);
}
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (processBA.subExists("activity_windowfocuschanged"))
processBA.raiseEvent2(null, true, "activity_windowfocuschanged", false, hasFocus);
}
private class B4AMenuItemsClickListener implements android.view.MenuItem.OnMenuItemClickListener {
private final String eventName;
public B4AMenuItemsClickListener(String eventName) {
this.eventName = eventName;
}
public boolean onMenuItemClick(android.view.MenuItem item) {
processBA.raiseEventFromUI(item.getTitle(), eventName + "_click");
return true;
}
}
public static Class<?> getObject() {
return main.class;
}
private Boolean onKeySubExist = null;
private Boolean onKeyUpSubExist = null;
@Override
public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
if (processBA.runHook("onkeydown", this, new Object[] {keyCode, event}))
return true;
if (onKeySubExist == null)
onKeySubExist = processBA.subExists("activity_keypress");
if (onKeySubExist) {
if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK &&
android.os.Build.VERSION.SDK_INT >= 18) {
HandleKeyDelayed hk = new HandleKeyDelayed();
hk.kc = keyCode;
BA.handler.post(hk);
return true;
}
else {
boolean res = new HandleKeyDelayed().runDirectly(keyCode);
if (res)
return true;
}
}
return super.onKeyDown(keyCode, event);
}
private class HandleKeyDelayed implements Runnable {
int kc;
public void run() {
runDirectly(kc);
}
public boolean runDirectly(int keyCode) {
Boolean res = (Boolean)processBA.raiseEvent2(_activity, false, "activity_keypress", false, keyCode);
if (res == null || res == true) {
return true;
}
else if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK) {
finish();
return true;
}
return false;
}
}
@Override
public boolean onKeyUp(int keyCode, android.view.KeyEvent event) {
if (processBA.runHook("onkeyup", this, new Object[] {keyCode, event}))
return true;
if (onKeyUpSubExist == null)
onKeyUpSubExist = processBA.subExists("activity_keyup");
if (onKeyUpSubExist) {
Boolean res = (Boolean)processBA.raiseEvent2(_activity, false, "activity_keyup", false, keyCode);
if (res == null || res == true)
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public void onNewIntent(android.content.Intent intent) {
super.onNewIntent(intent);
this.setIntent(intent);
processBA.runHook("onnewintent", this, new Object[] {intent});
}
@Override
public void onPause() {
super.onPause();
if (_activity == null)
return;
if (this != mostCurrent)
return;
anywheresoftware.b4a.Msgbox.dismiss(true);
BA.LogInfo("** Activity (main) Pause, UserClosed = " + activityBA.activity.isFinishing() + " **");
if (mostCurrent != null)
processBA.raiseEvent2(_activity, true, "activity_pause", false, activityBA.activity.isFinishing());
processBA.setActivityPaused(true);
mostCurrent = null;
if (!activityBA.activity.isFinishing())
previousOne = new WeakReference<Activity>(this);
anywheresoftware.b4a.Msgbox.isDismissing = false;
processBA.runHook("onpause", this, null);
}
@Override
public void onDestroy() {
super.onDestroy();
previousOne = null;
processBA.runHook("ondestroy", this, null);
}
@Override
public void onResume() {
super.onResume();
mostCurrent = this;
anywheresoftware.b4a.Msgbox.isDismissing = false;
if (activityBA != null) { //will be null during activity create (which waits for AfterLayout).
ResumeMessage rm = new ResumeMessage(mostCurrent);
BA.handler.post(rm);
}
processBA.runHook("onresume", this, null);
}
private static class ResumeMessage implements Runnable {
private final WeakReference<Activity> activity;
public ResumeMessage(Activity activity) {
this.activity = new WeakReference<Activity>(activity);
}
public void run() {
main mc = mostCurrent;
if (mc == null || mc != activity.get())
return;
processBA.setActivityPaused(false);
BA.LogInfo("** Activity (main) Resume **");
if (mc != mostCurrent)
return;
processBA.raiseEvent(mc._activity, "activity_resume", (Object[])null);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode,
android.content.Intent data) {
processBA.onActivityResult(requestCode, resultCode, data);
processBA.runHook("onactivityresult", this, new Object[] {requestCode, resultCode});
}
private static void initializeGlobals() {
processBA.raiseEvent2(null, true, "globals", false, (Object[])null);
}
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
for (int i = 0;i < permissions.length;i++) {
Object[] o = new Object[] {permissions[i], grantResults[i] == 0};
processBA.raiseEventFromDifferentThread(null,null, 0, "activity_permissionresult", true, o);
}
}
public anywheresoftware.b4a.keywords.Common __c = null;
public com.AB.ABZxing.ABZxing _myabbarcode = null;
public anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
public anywheresoftware.b4a.objects.ButtonWrapper _button1 = null;
public b4a.example.starter _starter = null;
public static boolean isAnyActivityVisible() {
boolean vis = false;
vis = vis | (main.mostCurrent != null);
return vis;}
public static String _activity_create(boolean _firsttime) throws Exception{
//BA.debugLineNum = 29;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
//BA.debugLineNum = 32;BA.debugLine="Activity.LoadLayout(\"Application\")";
mostCurrent._activity.LoadLayout("Application",mostCurrent.activityBA);
//BA.debugLineNum = 34;BA.debugLine="End Sub";
return "";
}
public static String _activity_pause(boolean _userclosed) throws Exception{
//BA.debugLineNum = 40;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
//BA.debugLineNum = 42;BA.debugLine="End Sub";
return "";
}
public static String _activity_resume() throws Exception{
//BA.debugLineNum = 36;BA.debugLine="Sub Activity_Resume";
//BA.debugLineNum = 38;BA.debugLine="End Sub";
return "";
}
public static String _button1_click() throws Exception{
//BA.debugLineNum = 45;BA.debugLine="Sub Button1_Click";
//BA.debugLineNum = 46;BA.debugLine="myABBarcode.ABGetBarcode(\"myabbarcode\", \"\")";
mostCurrent._myabbarcode.ABGetBarcode(mostCurrent.activityBA,"myabbarcode","");
//BA.debugLineNum = 47;BA.debugLine="End Sub";
return "";
}
public static String _globals() throws Exception{
//BA.debugLineNum = 21;BA.debugLine="Sub Globals";
//BA.debugLineNum = 24;BA.debugLine="Dim myABBarcode As ABZxing";
mostCurrent._myabbarcode = new com.AB.ABZxing.ABZxing();
//BA.debugLineNum = 25;BA.debugLine="Private Label1 As Label";
mostCurrent._label1 = new anywheresoftware.b4a.objects.LabelWrapper();
//BA.debugLineNum = 26;BA.debugLine="Private Button1 As Button";
mostCurrent._button1 = new anywheresoftware.b4a.objects.ButtonWrapper();
//BA.debugLineNum = 27;BA.debugLine="End Sub";
return "";
}
public static String _myabbarcode_barcodefound(String _barcode,String _formatname) throws Exception{
//BA.debugLineNum = 49;BA.debugLine="Sub myABBarcode_BarcodeFound(barCode As String, fo";
//BA.debugLineNum = 50;BA.debugLine="Label1.Text=barCode";
mostCurrent._label1.setText(BA.ObjectToCharSequence(_barcode));
//BA.debugLineNum = 51;BA.debugLine="End Sub";
return "";
}
public static String _myabbarcode_canceled() throws Exception{
//BA.debugLineNum = 52;BA.debugLine="Sub myABBarcode_Canceled";
//BA.debugLineNum = 53;BA.debugLine="msgbox(\"Canceled\",\"\")";
anywheresoftware.b4a.keywords.Common.Msgbox(BA.ObjectToCharSequence("Canceled"),BA.ObjectToCharSequence(""),mostCurrent.activityBA);
//BA.debugLineNum = 54;BA.debugLine="End Sub";
return "";
}
public static void initializeProcessGlobals() {
if (main.processGlobalsRun == false) {
main.processGlobalsRun = true;
try {
main._process_globals();
starter._process_globals();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}public static String _process_globals() throws Exception{
//BA.debugLineNum = 15;BA.debugLine="Sub Process_Globals";
//BA.debugLineNum = 19;BA.debugLine="End Sub";
return "";
}
}

View File

@@ -0,0 +1,161 @@
package b4a.example;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.objects.ServiceHelper;
import anywheresoftware.b4a.debug.*;
public class starter extends android.app.Service{
public static class starter_BR extends android.content.BroadcastReceiver {
@Override
public void onReceive(android.content.Context context, android.content.Intent intent) {
BA.LogInfo("** Receiver (starter) OnReceive **");
android.content.Intent in = new android.content.Intent(context, starter.class);
if (intent != null)
in.putExtra("b4a_internal_intent", intent);
ServiceHelper.StarterHelper.startServiceFromReceiver (context, in, true, BA.class);
}
}
static starter mostCurrent;
public static BA processBA;
private ServiceHelper _service;
public static Class<?> getObject() {
return starter.class;
}
@Override
public void onCreate() {
super.onCreate();
mostCurrent = this;
if (processBA == null) {
processBA = new BA(this, null, null, "b4a.example", "b4a.example.starter");
if (BA.isShellModeRuntimeCheck(processBA)) {
processBA.raiseEvent2(null, true, "SHELL", false);
}
try {
Class.forName(BA.applicationContext.getPackageName() + ".main").getMethod("initializeProcessGlobals").invoke(null, null);
} catch (Exception e) {
throw new RuntimeException(e);
}
processBA.loadHtSubs(this.getClass());
ServiceHelper.init();
}
_service = new ServiceHelper(this);
processBA.service = this;
if (BA.isShellModeRuntimeCheck(processBA)) {
processBA.raiseEvent2(null, true, "CREATE", true, "b4a.example.starter", processBA, _service, anywheresoftware.b4a.keywords.Common.Density);
}
if (!true && ServiceHelper.StarterHelper.startFromServiceCreate(processBA, false) == false) {
}
else {
processBA.setActivityPaused(false);
BA.LogInfo("*** Service (starter) Create ***");
processBA.raiseEvent(null, "service_create");
}
processBA.runHook("oncreate", this, null);
if (true) {
ServiceHelper.StarterHelper.runWaitForLayouts();
}
}
@Override
public void onStart(android.content.Intent intent, int startId) {
onStartCommand(intent, 0, 0);
}
@Override
public int onStartCommand(final android.content.Intent intent, int flags, int startId) {
if (ServiceHelper.StarterHelper.onStartCommand(processBA, new Runnable() {
public void run() {
handleStart(intent);
}}))
;
else {
ServiceHelper.StarterHelper.addWaitForLayout (new Runnable() {
public void run() {
processBA.setActivityPaused(false);
BA.LogInfo("** Service (starter) Create **");
processBA.raiseEvent(null, "service_create");
handleStart(intent);
ServiceHelper.StarterHelper.removeWaitForLayout();
}
});
}
processBA.runHook("onstartcommand", this, new Object[] {intent, flags, startId});
return android.app.Service.START_NOT_STICKY;
}
public void onTaskRemoved(android.content.Intent rootIntent) {
super.onTaskRemoved(rootIntent);
if (true)
processBA.raiseEvent(null, "service_taskremoved");
}
private void handleStart(android.content.Intent intent) {
BA.LogInfo("** Service (starter) Start **");
java.lang.reflect.Method startEvent = processBA.htSubs.get("service_start");
if (startEvent != null) {
if (startEvent.getParameterTypes().length > 0) {
anywheresoftware.b4a.objects.IntentWrapper iw = ServiceHelper.StarterHelper.handleStartIntent(intent, _service, processBA);
processBA.raiseEvent(null, "service_start", iw);
}
else {
processBA.raiseEvent(null, "service_start");
}
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (true) {
BA.LogInfo("** Service (starter) Destroy (ignored)**");
}
else {
BA.LogInfo("** Service (starter) Destroy **");
processBA.raiseEvent(null, "service_destroy");
processBA.service = null;
mostCurrent = null;
processBA.setActivityPaused(true);
processBA.runHook("ondestroy", this, null);
}
}
@Override
public android.os.IBinder onBind(android.content.Intent intent) {
return null;
}public anywheresoftware.b4a.keywords.Common __c = null;
public b4a.example.main _main = null;
public static boolean _application_error(anywheresoftware.b4a.objects.B4AException _error,String _stacktrace) throws Exception{
//BA.debugLineNum = 28;BA.debugLine="Sub Application_Error (Error As Exception, StackTr";
//BA.debugLineNum = 29;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
//BA.debugLineNum = 30;BA.debugLine="End Sub";
return false;
}
public static String _process_globals() throws Exception{
//BA.debugLineNum = 6;BA.debugLine="Sub Process_Globals";
//BA.debugLineNum = 10;BA.debugLine="End Sub";
return "";
}
public static String _service_create() throws Exception{
//BA.debugLineNum = 12;BA.debugLine="Sub Service_Create";
//BA.debugLineNum = 16;BA.debugLine="End Sub";
return "";
}
public static String _service_destroy() throws Exception{
//BA.debugLineNum = 32;BA.debugLine="Sub Service_Destroy";
//BA.debugLineNum = 34;BA.debugLine="End Sub";
return "";
}
public static String _service_start(anywheresoftware.b4a.objects.IntentWrapper _startingintent) throws Exception{
//BA.debugLineNum = 18;BA.debugLine="Sub Service_Start (StartingIntent As Intent)";
//BA.debugLineNum = 21;BA.debugLine="End Sub";
return "";
}
public static String _service_taskremoved() throws Exception{
//BA.debugLineNum = 23;BA.debugLine="Sub Service_TaskRemoved";
//BA.debugLineNum = 25;BA.debugLine="End Sub";
return "";
}
}

40
Archiv/Starter.bas Normal file
View File

@@ -0,0 +1,40 @@
B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Service
Version=8.8
@EndOfDesignText@
#Region Service Attributes
#StartAtBoot: False
#ExcludeFromLibrary: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Service_Create
'This is the program entry point.
'This is a good place to load resources that are not specific to a single activity.
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub Service_TaskRemoved
'This event will be raised when the user removes the app from the recent apps list.
End Sub
'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub Service_Destroy
End Sub

51
DPMCharge/About.bas Normal file
View File

@@ -0,0 +1,51 @@
B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Activity
Version=11
@EndOfDesignText@
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private ImageView1 As ImageView
Private Label5 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("About")
Activity.Title="Über..."
Label5.text=Chr(0x00A9)& "2021 - Stefan Hutter Unternehmensberatung"
Dim Any As Animation
Any.InitializeRotateCenter("",360,0,ImageView1)
Any.Duration=3000
ImageView1.Tag=Any
Any.Start(ImageView1)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Private Sub Button3_Click
Activity.Finish
End Sub

253
DPMCharge/AppMain.bas Normal file
View File

@@ -0,0 +1,253 @@
B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Activity
Version=11
@EndOfDesignText@
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Public PatID As String
Public sURL As String=""
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private bs1 As BillScanner
Private Button1 As Button
Private Button2 As Button
Dim JobName As String
Dim PatName As String
Private txtPatNr As EditText
Private pnlEnterPatID As Panel
Private lblPatient As Label
Private timeout As Long
Private dtnow As Long
Private btnSearchPat As Button
Dim PatTimer As Timer
Dim StartTimer As Timer
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.AddMenuItem("Parameter","bt1")
Activity.AddMenuItem("Über...","bt2")
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
Activity.Title="DPM - Charge Scanner"
bs1.ScanMode = bs1.FORMAT_ONE_D
PatID=0
If File.Exists(File.DirInternal ,"DPM.ini") = True Then
Get_Params
Else
'StartActivity("Param")
End If
PatTimer.Initialize("timer",timeout)
If TempData.pid<>"" Then
get_Pat(TempData.pid)
TempData.pid=""
End If
End Sub
Sub Activity_Resume
If TempData.pid<>"" Then PatID=TempData.pid
If File.Exists(File.DirInternal ,"DPM.ini") = True Then
Get_Params
PatTimer.Enabled=False
PatTimer.Initialize("timer",timeout)
PatTimer.Enabled=True
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Try
bs1.stopScanning
Catch
End Try
PatID=0
End Sub
Sub Timer_Tick
PatID=0
lblPatient.Text="Bitte Patient auswählen"
End Sub
Sub Get_Params
Dim TR As TextReader
Dim inp As InputStream
inp=File.OpenInput(File.DirInternal , "DPM.ini")
TR.Initialize(inp)
Try
sURL=TR.Readline
Catch
sURL=""
End Try
Try
timeout = TR.ReadLine
Catch
timeout=30000
End Try
TR.Close
End Sub
Sub DateDiff (units, date1, date2)
Try
Dim x As Long
Dim y As Long
Dim z As Long
x=DateTime.DateParse(date1)
y=DateTime.DateParse(date2)
Select units
Case "ss"
z=60
End Select
Return (y-x) / z
Catch
Return 10
End Try
End Sub
Sub bs1_scan_value(val As String, rawbyte() As Byte, barcodetype As Int)
'bs1.stopScanning
'Log("Value = " & val)
'Log("type = " & barcodetype)
'Log(" ")
If DateDiff("ss",dtnow,DateTime.Now)<2 Then Return
Dim job As HttpJob
JobName="PostCharche"
job.Initialize(JobName, Me)
dtnow=DateTime.Now
job.PostString(sURL&"/DPMService/api/PatCharge/"&PatID&"/"&val,"")
Dim b As Beeper
b.Initialize(300, 500) '300 milliseconds, 500 hz
'b.Beep
PatTimer.Enabled=True
End Sub
Sub Button1_Click
If PatID=0 Then
ToastMessageShow("Bitte zuerst Patient wählen",True)
End If
bs1.startScanning
PatTimer.Enabled=False
End Sub
Private Sub Button2_Click
Try
bs1.stopScanning
Catch
End Try
End Sub
Sub get_Pat(id As String)
Dim job As HttpJob
JobName="GetPat"
job.Initialize(JobName, Me)
Dim callurl As String
callurl=sURL&"/DPMService/api/Service_View_Pat/"&id
job.Download(callurl)
'job.Download("http://192.168.111.67/DPMService/api/Service_View_Pat/"&id)
End Sub
Sub JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
Dim res As String
res = Job.GetString
Dim parser As JSONParser
parser.Initialize(res)
Log("Response from server: " & res)
Select Job.JobName
Case "GetPat"
Dim list1 As List
list1 = parser.NextArray
If list1.Size<1 Then
ToastMessageShow("Patient nicht vorhanden.",True)
pnlEnterPatID.Visible=True
Return
End If
Dim map1 As Map
map1 = list1.Get(0)
Log(map1)
PatID = map1.Get("id")
PatName=map1.Get("pat")
lblPatient.Text=PatName
Case "PostCharche"
ToastMessageShow("Barcode erfolgreich gespeichert",False)
End Select
Else
ToastMessageShow("Funktionsaufruf fehlgeschlagen.",True)
End If
Job.Release
End Sub
Private Sub btnSearchPat_Click
PatTimer.Enabled=False
get_Pat(txtPatNr.Text)
pnlEnterPatID.Visible=False
btnSearchPat.RequestFocus
PatTimer.Enabled=True
End Sub
Private Sub btnEnterPatID_Click
txtPatNr.ForceDoneButton=True
pnlEnterPatID.Visible=True
txtPatNr.Text=""
txtPatNr.RequestFocus
End Sub
Private Sub lblPatient_LongClick
StartActivity("Param")
End Sub
Sub bt1_Click
StartActivity("Param")
End Sub
Sub bt2_click
StartActivity("About")
End Sub
Private Sub btnListdata_Click
'StartActivity(ListData)
'CallSubDelayed3(ListData,"get_data",txtPatNr.text,sURL)
ListData.PatID=PatID
TempData.pid=PatID
TempData.pname=lblPatient.Text
ListData.sURL=sURL
'CallSubDelayed(ListData,"")
StartActivity("ListData")
End Sub

306
DPMCharge/DPMCharge.b4a Normal file
View File

@@ -0,0 +1,306 @@
Build1=Default,shub.dpm
Build2=DPM,shub.dpm,Vollversion
File1=About.bal
File10=StopScan.png
File2=daten.png
File3=icon.png
File4=LData.bal
File5=main.bal
File6=Parameter.bal
File7=Patient.png
File8=Scan.PNG
File9=Splash.bal
FileGroup1=Default Group
FileGroup10=Default Group
FileGroup2=Default Group
FileGroup3=Default Group
FileGroup4=Default Group
FileGroup5=Default Group
FileGroup6=Default Group
FileGroup7=Default Group
FileGroup8=Default Group
FileGroup9=Default Group
Group=Default Group
Library1=animation
Library10=xui
Library11=xui views
Library12=xui2d
Library13=dateutils
Library2=audio
Library3=billscanner
Library4=core
Library5=javaobject
Library6=json
Library7=okhttputils2
Library8=phone
Library9=stringfunctions
ManifestCode='This code will be applied to the manifest file during compilation.~\n~'You do not need to modify it in most cases.~\n~'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136~\n~AddManifestText(~\n~<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>~\n~<supports-screens android:largeScreens="true" ~\n~ android:normalScreens="true" ~\n~ android:smallScreens="true" ~\n~ android:anyDensity="true"/>)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~CreateResourceFromFile(Macro, Themes.DarkTheme)~\n~CreateResourceFromFile(Macro, Core.NetworkClearText)~\n~'End of default text.~\n~~\n~AddApplicationText(<meta-data~\n~ android:name="com.google.android.gms.version"~\n~ android:value="@integer/google_play_services_version" />~\n~ <meta-data~\n~ android:name="com.google.android.gms.vision.DEPENDENCIES"~\n~ android:value="barcode" />)~\n~' <meta-data~\n~' android:name="com.google.android.gms.vision.DEPENDENCIES"~\n~' android:value="ocr" />)~\n~ ~\n~AddManifestText(<uses-feature android:name="android.hardware.camera" android:required="true" />)~\n~AddManifestText(<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />)~\n~AddManifestText(<uses-feature android:name="android.hardware.camera.flash" android:required="false" />)~\n~~\n~~\n~''Put your key here!!!!!!!!!!! ~\n~'AddApplicationText(<meta-data android:name="my_api_key" android:value="b68f0ca489d783d318c07cc7b244227aabd5-97e5-11e8-bbf1-4b59" />~\n~') ~\n~'SetApplicationAttribute(android:name, "androidx.multidex.MultiDexApplication")
Module1=About
Module2=AppMain
Module3=ListData
Module4=Param
Module5=Starter
Module6=TempData
NumberOfFiles=10
NumberOfLibraries=13
NumberOfModules=6
Version=11
@EndOfDesignText@
#Region Project Attributes
#ApplicationLabel: DPM ChargeScan
#VersionCode: 1
#VersionName: Initial
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#MultiDex: True
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
'Public PatID As String
'Public sURL As String=""
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
' Private bs1 As BillScanner
' Private Button1 As Button
'
' Private Button2 As Button
' Dim JobName As String
'
' Dim PatName As String
' Private txtPatNr As EditText
' Private pnlEnterPatID As Panel
' Private lblPatient As Label
' Private timeout As Long
'
'
'
' Private btnSearchPat As Button
' Dim PatTimer As Timer
' Dim StartTimer As Timer
Private Label3 As Label
Private ImageView1 As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime=True Then
Activity.LoadLayout("Splash")
Label3.text= Chr(0x00A9)& "2021 - Stefan Hutter Unternehmensberatung"
Dim ani As Animation
ImageView1.Left=(100%x-ImageView1.Width)/2
ani.InitializeScaleCenter("",0,0,1,1,ImageView1)
ani.Duration=800
ImageView1.Tag=ani
ani.Start(ImageView1)
Sleep(4000)
End If
StartActivity("AppMain")
End Sub
' Activity.AddMenuItem("Parameter","bt1")
' Activity.AddMenuItem("Über...","bt2")
' 'Do not forget to load the layout file created with the visual designer. For example:
' Activity.LoadLayout("main")
' Activity.Title="DPM - Charge-Scanner"
' bs1.ScanMode = bs1.FORMAT_ONE_D
' PatID=0
' If File.Exists(File.DirInternal ,"DPM.ini") = True Then
' Get_Params
' Else
' 'StartActivity("Param")
' End If
' PatTimer.Initialize("timer",timeout)
' If TempData.pid<>"" Then
' get_Pat(TempData.pid)
' TempData.pid=""
' End If
' End Sub
'
' Sub Activity_Resume
' If TempData.pid<>"" Then PatID=TempData.pid
' If File.Exists(File.DirInternal ,"DPM.ini") = True Then
' Get_Params
' PatTimer.Enabled=False
' PatTimer.Initialize("timer",timeout)
' PatTimer.Enabled=True
' End If
' End Sub
'
' Sub Activity_Pause (UserClosed As Boolean)
'
' Try
' bs1.stopScanning
' Catch
' End Try
' PatID=0
' End Sub
'
'
' Sub Timer_Tick
' PatID=0
' lblPatient.Text="Bitte Patient auswählen"
' End Sub
'
' Sub Get_Params
' Dim TR As TextReader
' Dim inp As InputStream
' inp=File.OpenInput(File.DirInternal , "DPM.ini")
' TR.Initialize(inp)
' Try
' sURL=TR.Readline
' Catch
' sURL=""
' End Try
' Try
' timeout = TR.ReadLine
'
' Catch
' timeout=30000
' End Try
'
' TR.Close
' End Sub
'
' Sub bs1_scan_value(val As String, rawbyte() As Byte, barcodetype As Int)
'
' Log("Value = " & val)
' Log("type = " & barcodetype)
' Log(" ")
'
' Dim job As HttpJob
' JobName="PostCharche"
' job.Initialize(JobName, Me)
'
' job.PostString(sURL&"/DPMService/api/PatCharge/"&PatID&"/"&val,"")
' bs1.stopScanning
' Dim b As Beeper
' b.Initialize(300, 500) '300 milliseconds, 500 hz
' b.Beep
' PatTimer.Enabled=True
' End Sub
'
' Sub Button1_Click
' If PatID=0 Then
' ToastMessageShow("Bitte zuerst Patient wählen",True)
' End If
' bs1.startScanning
' PatTimer.Enabled=False
' End Sub
'
' Private Sub Button2_Click
' Try
' bs1.stopScanning
' Catch
' End Try
' End Sub
'
'
' Sub get_Pat(id As String)
' Dim job As HttpJob
' JobName="GetPat"
' job.Initialize(JobName, Me)
'
' Dim callurl As String
' callurl=sURL&"/DPMService/api/Service_View_Pat/"&id
' job.Download(callurl)
' 'job.Download("http://192.168.111.67/DPMService/api/Service_View_Pat/"&id)
'
' End Sub
'
'
' Sub JobDone(Job As HttpJob)
' ProgressDialogHide
' If Job.Success Then
' Dim res As String
' res = Job.GetString
' Dim parser As JSONParser
' parser.Initialize(res)
'
' Log("Response from server: " & res)
'
' Select Job.JobName
' Case "GetPat"
'
' Dim list1 As List
' list1 = parser.NextArray
' If list1.Size<1 Then
' ToastMessageShow("Patient nicht vorhanden.",True)
' pnlEnterPatID.Visible=True
' Return
' End If
' Dim map1 As Map
' map1 = list1.Get(0)
' Log(map1)
'
' PatID = map1.Get("id")
' PatName=map1.Get("pat")
' lblPatient.Text=PatName
' Case "PostCharche"
' ToastMessageShow("Barcode erfolgreich gespeichert",False)
' End Select
' Else
' ToastMessageShow("Funktionsaufruf fehlgeschlagen.",True)
' End If
' Job.Release
' End Sub
'
'
'
' Private Sub btnSearchPat_Click
' PatTimer.Enabled=False
' get_Pat(txtPatNr.Text)
' pnlEnterPatID.Visible=False
' btnSearchPat.RequestFocus
' PatTimer.Enabled=True
' End Sub
'
' Private Sub btnEnterPatID_Click
' txtPatNr.ForceDoneButton=True
' pnlEnterPatID.Visible=True
' txtPatNr.Text=""
' txtPatNr.RequestFocus
' End Sub
'
' Private Sub lblPatient_LongClick
' StartActivity("Param")
' End Sub
'
' Sub bt1_Click
' StartActivity("Param")
' End Sub
' Sub bt2_click
' StartActivity("About")
' End Sub
'
' Private Sub btnListdata_Click
'
' 'StartActivity(ListData)
' 'CallSubDelayed3(ListData,"get_data",txtPatNr.text,sURL)
' ListData.PatID=PatID
' TempData.pid=PatID
' TempData.pname=lblPatient.Text
' ListData.sURL=sURL
' 'CallSubDelayed(ListData,"")
'
' StartActivity("ListData")
' End Sub
'

View File

@@ -0,0 +1,24 @@
ModuleBookmarks0=
ModuleBookmarks1=
ModuleBookmarks2=
ModuleBookmarks3=
ModuleBookmarks4=
ModuleBookmarks5=
ModuleBookmarks6=
ModuleBreakpoints0=
ModuleBreakpoints1=
ModuleBreakpoints2=127
ModuleBreakpoints3=
ModuleBreakpoints4=
ModuleBreakpoints5=
ModuleBreakpoints6=
ModuleClosedNodes0=
ModuleClosedNodes1=
ModuleClosedNodes2=
ModuleClosedNodes3=
ModuleClosedNodes4=
ModuleClosedNodes5=
ModuleClosedNodes6=
NavigationStack=AppMain,JobDone,177,0,AppMain,Activity_Create,37,0,AppMain,Timer_Tick,78,0,AppMain,Activity_Pause,73,0,AppMain,Button2_Click,132,0,AppMain,Globals,29,6,AppMain,Get_Params,101,0,AppMain,Button1_Click,141,0,AppMain,bs1_scan_value,126,6,AppMain,DateDiff,102,6
SelectedBuild=0
VisibleModules=3,4,5,6,1,2

18
DPMCharge/DPMCharge.meta Normal file
View File

@@ -0,0 +1,18 @@
ModuleBookmarks0=
ModuleBookmarks1=
ModuleBookmarks2=
ModuleBookmarks3=
ModuleBookmarks4=
ModuleBreakpoints0=
ModuleBreakpoints1=
ModuleBreakpoints2=
ModuleBreakpoints3=
ModuleBreakpoints4=
ModuleClosedNodes0=
ModuleClosedNodes1=
ModuleClosedNodes2=
ModuleClosedNodes3=
ModuleClosedNodes4=
NavigationStack=Main,Activity_Create,49,6,Main,lblPatient_LongClick,206,0,Main,bt1_Click,206,0,ListData,AddRow,199,0,ListData,JobDone,79,0,ListData,Globals,31,0,ListData,Cell_LongClick,123,3,ListData,bClose_Click,258,0,ListData,Activity_Pause,241,0,Main,Button2_Click,135,3,Main,bs1_scan_value,107,0
SelectedBuild=0
VisibleModules=3,2,1,4

BIN
DPMCharge/Files/about.bal Normal file

Binary file not shown.

BIN
DPMCharge/Files/daten.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
DPMCharge/Files/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
DPMCharge/Files/ldata.bal Normal file

Binary file not shown.

BIN
DPMCharge/Files/main.bal Normal file

Binary file not shown.

Binary file not shown.

BIN
DPMCharge/Files/patient.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
DPMCharge/Files/scan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
DPMCharge/Files/splash.bal Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

265
DPMCharge/ListData.bas Normal file
View File

@@ -0,0 +1,265 @@
B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Activity
Version=11
@EndOfDesignText@
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Public PatID As String
Public sURL As String
End Sub
Sub Globals
Dim jobname As String
Dim SV As ScrollView
Dim BtnClose As Button
Dim Header As Panel
Dim Table As Panel
Dim NumberOfColumns, RowHeight, ColumnWidth As Int
Dim HeaderColor, TableColor, FontColor, HeaderFontColor As Int
Dim FontSize As Float
Type RowCol (Row As Int, Col As Int)
Dim Alignment As Int
Dim SelectedRow As Int
Dim SelectedRowColor As Int
'Table settings
HeaderColor = Colors.Gray
NumberOfColumns = 3
RowHeight = 30dip
TableColor = Colors.White
FontColor = Colors.Black
HeaderFontColor = Colors.White
FontSize = 11
Alignment = Gravity.CENTER 'change to Gravity.LEFT or Gravity.RIGHT for other alignments.
SelectedRowColor = Colors.Blue
Dim list1 As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
init_view
End Sub
Sub init_view
SV.Initialize(0)
Activity.LoadLayout("LData")
Table = SV.Panel
Table.Color = TableColor
Activity.AddView(SV, 5%x, 10%y, 90%x, 80%y)
ColumnWidth = SV.Width / NumberOfColumns
SelectedRow = -1
'add header
SetHeader(Array As String("ID", "Charge", "Datum"))
'add rows
Get_Data
Activity.Title="Daten " & TempData.pname
End Sub
Sub Get_Data
Dim job As HttpJob
jobname="GetData"
job.Initialize(jobname, Me)
job.Download(sURL&"/DPMService/api/PatCharge/"&PatID)
End Sub
Sub JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
Dim res As String
res = Job.GetString
Dim parser As JSONParser
parser.Initialize(res)
Log("Response from server: " & res)
Select Job.JobName
Case "DelData"
list1.Clear
Table.RemoveAllViews
init_view
'Get_Data
Case "GetData"
list1 = parser.NextArray
Dim i As Int
For i=0 To list1.Size-1
Dim map1 As Map
map1=list1.Get(i)
Dim s1 As String
Dim s2 As String
Dim s3 As String
s1=map1.Get("id")
s2=map1.Get("charge")
s3=map1.Get("datum")
AddRow(Array As String(s1,s2,s3))
Next
If list1.Size<1 Then
ToastMessageShow("Keine Daten vorhanden.",True)
Return
End If
End Select
End If
End Sub
Sub Cell_LongClick
Dim rc As RowCol
Dim l As Label
Dim x As String
x=""
l = Sender
rc = l.Tag
SelectRow(rc.Row)
' Activity.Title = "Cell clicked: (" & rc.Row & ", " & rc.Col &")"
For i=0 To list1.Size-1
If i=rc.Row Then
Dim map1 As Map
map1=list1.Get(i)
x=map1.Get("id")
'ToastMessageShow(map1.Get("id"),False)
End If
Next
If x<>"" Then
Msgbox2Async("Eintrag Nr. "&x&" wirkllich löschen?", "Charge-Eintrag löschen", "Ja", "Nein", "", Null, False)
Wait For MsgBox_Result (Result As Int)
If Result = DialogResponse.POSITIVE Then
Dim job As HttpJob
jobname="DelData"
job.Initialize(jobname, Me)
job.Delete(sURL&"/DPMService/api/PatCharge/"&x)
End If
End If
End Sub
Sub Cell_Click
Dim rc As RowCol
Dim l As Label
l = Sender
rc = l.Tag
SelectRow(rc.Row)
' Activity.Title = "Cell clicked: (" & rc.Row & ", " & rc.Col &")"
For i=0 To list1.Size-1
If i=rc.Row Then
Dim map1 As Map
map1=list1.Get(i)
'ToastMessageShow(map1.Get("id"),False)
End If
Next
End Sub
Sub Header_Click
Dim l As Label
Dim col As Int
l = Sender
col = l.Tag
' Activity.Title = "Header clicked: " & col
End Sub
Sub SelectRow(Row As Int)
'remove the color of previously selected row
If SelectedRow > -1 Then
For col = 0 To NumberOfColumns - 1
GetView(SelectedRow, col).Color = Colors.Transparent
Next
End If
SelectedRow = Row
For col = 0 To NumberOfColumns - 1
GetView(Row, col).Color = SelectedRowColor
Next
End Sub
Sub GetView(Row As Int, Col As Int) As Label
Dim l As Label
l = Table.GetView(Row * NumberOfColumns + Col)
Return l
End Sub
Sub AddRow(Values() As String)
If Values.Length <> NumberOfColumns Then
Log("Wrong number of values.")
Return
End If
Dim lastRow As Int
lastRow = NumberOfRows
For i = 0 To NumberOfColumns - 1
Dim l As Label
l.Initialize("cell")
l.Text = Values(i)
l.Gravity = Alignment
l.TextSize = FontSize
l.TextColor = FontColor
Dim rc As RowCol
rc.Initialize
rc.Col = i
rc.Row = lastRow
l.Tag = rc
Table.AddView(l, ColumnWidth * i, RowHeight * lastRow, ColumnWidth, RowHeight)
Next
Table.Height = NumberOfRows * RowHeight
End Sub
Sub SetHeader(Values() As String)
If Header.IsInitialized Then Return 'should only be called once
Header.Initialize("")
For i = 0 To NumberOfColumns - 1
Dim l As Label
l.Initialize("header")
l.Text = Values(i)
l.Gravity = Gravity.CENTER
l.TextSize = FontSize
l.Color = HeaderColor
l.TextColor = HeaderFontColor
l.Tag = i
Header.AddView(l, ColumnWidth * i, 0, ColumnWidth, RowHeight)
Next
Activity.AddView(Header, SV.Left, SV.Top - RowHeight, SV.Width, RowHeight)
End Sub
Sub NumberOfRows As Int
Return Table.NumberOfViews / NumberOfColumns
End Sub
Sub SetCell(Row As Int, Col As Int, Value As String)
GetView(Row, Col).Text = Value
End Sub
Sub GetCell(Row As Int, Col As Int) As String
Return GetView(Row, Col).Text
End Sub
Sub ClearAll
For i = Table.NumberOfViews -1 To 0 Step -1
Table.RemoveViewAt(i)
Next
Table.Height = 0
SelectedRow = -1
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
'Sub get_DATA(id As String, surl As String)
'Dim job As HttpJob
'jobname="GetPat"
'job.Initialize(jobname, Me)
'
'Dim callurl As String
'callurl=surl&"/DPMService/api/Service_View_Pat/"&id
'job.Download(callurl)
''job.Download("http://192.168.111.67/DPMService/api/Service_View_Pat/"&id)
'
'End Sub
Private Sub bClose_Click
Activity.Finish
'StartActivity("Main")
End Sub

View File

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="shub.dpm"
android:versionCode="1"
android:versionName="Initial"
android:installLocation="internalOnly">
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.hardware.camera"/>
<uses-permission android:name="android.hardware.camera.autofocus"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application
android:name="androidx.multidex.MultiDexApplication"
android:icon="@drawable/icon"
android:label="DPM ChargeScan"
android:theme="@style/DarkTheme"
android:networkSecurityConfig="@xml/network_security_config">
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="barcode" />
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".main"
android:label="DPM ChargeScan"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".listdata"
android:label="DPM ChargeScan"
android:screenOrientation="portrait">
</activity>
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".param"
android:label="DPM ChargeScan"
android:screenOrientation="portrait">
</activity>
<service android:name=".starter">
</service>
<receiver android:name=".starter$starter_BR">
</receiver>
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".about"
android:label="DPM ChargeScan"
android:screenOrientation="portrait">
</activity>
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".appmain"
android:label="DPM ChargeScan"
android:screenOrientation="portrait">
</activity>
<service android:name=".httputils2service">
</service>
<receiver android:name=".httputils2service$httputils2service_BR">
</receiver>
</application>
</manifest>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,37 @@
.b4xdialog .scroll-bar:horizontal, .b4xdialog .scroll-bar:vertical{
-fx-background-color:transparent;
}
.b4xdialog .increment-button, .b4xdialog .decrement-button {
-fx-background-color: transparent;
-fx-border-color: transparent;
}
.b4xdialog .scroll-bar:horizontal .track,
.b4xdialog .scroll-bar:vertical .track{
-fx-background-color: transparent;
-fx-border-color: transparent;
-fx-background-radius: 0em;
}
.b4xdialog .scroll-bar:horizontal .thumb,
.b4xdialog .scroll-bar:vertical .thumb {
-fx-background-color: #4B4B4B;
-fx-background-radius: 5em;
}
.b4xdialoglight .scroll-bar:horizontal .thumb,
.b4xdialoglight .scroll-bar:vertical .thumb {
-fx-background-color: #B8B8B8;
}
.scroll-pane{
-fx-background-color:transparent;
}
.scroll-pane .viewport {
-fx-background-color: transparent;
}
.text-area .content {
-fx-padding: 15 5 5 5;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More