Compare commits
No commits in common. "vinoth" and "main" have entirely different histories.
@ -14,14 +14,6 @@
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
|
||||
android:theme="@style/Theme.LifelineTest2">
|
||||
<receiver android:name=".BootReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
package com.example.lifeline_test2;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
public class BootReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent){
|
||||
if(Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()) || Intent.ACTION_LOCKED_BOOT_COMPLETED.equals(intent.getAction())){
|
||||
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
if(am!=null) {
|
||||
am.clearApplicationUserData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
package com.example.lifeline_test2;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@ -82,27 +81,17 @@ protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
WebView webView = new WebView(this);
|
||||
setContentView(webView);
|
||||
|
||||
WebSettings webSettings = webView.getSettings();
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
|
||||
webView.addJavascriptInterface(new WebAppInterface(this), "AndroidPrinter");
|
||||
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
webView.setWebViewClient(new WebViewClient());
|
||||
|
||||
CookieManager.getInstance().setAcceptCookie(true);
|
||||
CookieManager.getInstance().setAcceptThirdPartyCookies(webView,true);
|
||||
|
||||
// 🔒 Stop rubber band effect + hide scrollbars
|
||||
webView.setOverScrollMode(WebView.OVER_SCROLL_NEVER);
|
||||
webView.setVerticalScrollBarEnabled(false);
|
||||
webView.setHorizontalScrollBarEnabled(false);
|
||||
|
||||
// webView.loadUrl("http://10.23.107.10:8000/kioskvideo");
|
||||
|
||||
|
||||
webView.loadUrl("http://192.168.0.108:8000/kioskvideo");
|
||||
webView.loadUrl("http://192.168.0.114:8000/kioskvideo");
|
||||
//webView.loadUrl("file:///android_asset/index.html");
|
||||
findUsbPrinter();
|
||||
}
|
||||
@ -168,7 +157,7 @@ protected void onCreate(Bundle savedInstanceState) {
|
||||
}
|
||||
|
||||
ESCPOS_Printer printer = new ESCPOS_Printer(usbDeviceConnection, usbEndpoint);
|
||||
printer.logo(AppCompatResources.getDrawable(this, R.drawable.updatedlogocropped));
|
||||
printer.logo(AppCompatResources.getDrawable(this, R.drawable.logo));
|
||||
printer.printFormatted(text);
|
||||
printer.feed(5);
|
||||
printer.cut();
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 61 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 92 KiB |
@ -1,3 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">Lifeline Production</string>
|
||||
<string name="app_name">Lifeline-Test2</string>
|
||||
</resources>
|
||||
Loading…
x
Reference in New Issue
Block a user