Skip to content

Instantly share code, notes, and snippets.

View maggocnx's full-sized avatar

Marco Grieb maggocnx

  • Gronic Systems
  • Birstein, Germany
View GitHub Profile
@maggocnx
maggocnx / Update.java
Created October 26, 2020 10:28
updating os
public class Updater {
public void runUpdate(){
try {
File file = new File("/cache/recovery/command");
FileOutputStream f = new FileOutputStream(file);
f.write("--update_package=/data/download.zip".getBytes());
f.close();
}
catch (IOException e) {
@maggocnx
maggocnx / AndroidManifest.xml
Created October 9, 2019 06:11 — forked from bjoernQ/AndroidManifest.xml
Creating a System Overlay (Always on Top over all Apps) in Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.mobilej.overlay"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" />
<application android:label="SystemOverlay" >
<activity
@maggocnx
maggocnx / switchnetwork.java
Last active July 11, 2018 11:53
Switch Network type
public void setEdge(View v){
setNetwork(1);
}
public void setLTE(View v){
setNetwork(7);
}
private void setNetwork(int networkType){
02-20 09:57:28.739 8547-8599/io.cordova.hellocordova E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/**injection**www/plugins/com.gronic.plugin.customPrint/www/customPrint.js
02-20 09:57:28.852 8547-8600/io.cordova.hellocordova W/System.err: at com.gronic.plugin.CustomPrint.execute(CustomPrint.java:148)
02-20 09:57:29.861 8547-8600/io.cordova.hellocordova I/CUSTOM: [I] Usb device SN:VKP80III_PRN_Num.:_0
02-20 09:57:29.861 8547-8600/io.cordova.hellocordova I/CUSTOM: [I] Usb device TX Packet Size:64
02-20 09:57:29.862 8547-8600/io.cordova.hellocordova I/CUSTOM: [I] Usb device RX Packet Size:64
02-20 09:57:29.920 8547-8600/io.cordova.hellocordova I/CUSTOM: [I] This printer doesn't supports GET PRINTER FEATURES...
02-20 09:57:29.922 8547-8600/io.cordova.hellocordova I/CUSTOM: [I] Custom VKP80III
02-20 09:57:29.928 8547-8600/io.cordova.hellocordova I/CUSTOM: [I] Status : 0x44 0x00 0x00 0x00
02-20 09:57:29.929 8547-8600/io.cordova.hellocordova I/CUSTOM: [I] Status :0x00000044
02-20
package com.gronic.updater;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.AsyncTask;
import android.os.Build;
#include "dsi-panel-bt1538b-720p-video.dtsi"
#include "dsi-panel-ili9881c-720p-video.dtsi"
#include "dsi-panel-hx8394d-720p-video.dtsi"
#include "dsi-panel-hx8394d-qhd-video.dtsi"
&mdss_mdp {
qcom,mdss-pref-prim-intf = "dsi";
};
{
"messageId" : 633000000272,
"value" : 14.04,
"date" : "2016-11-18T15:14:58",
"target" : 125.00,
"orderId" : 9,
"gpio" : [
{
"id" : 1,
"direction" : "in",
@maggocnx
maggocnx / index.html
Last active April 23, 2016 09:13
Printing
<!DOCTYPE html>
<html ng-app="epaykiosk" >
<head >
<title>EpayKiosk</title>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-io-barcode/build/angular-io-barcode.min.js"></script>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<style>
body {
background-color: #000;
@maggocnx
maggocnx / draw.js
Last active April 12, 2016 06:51
Painting on Canvas
function init() {
canvas = document.getElementById('can');
ctx = canvas.getContext("2d");
w = canvas.width;
h = canvas.height;
canvas.addEventListener("touchmove", function (e) {
findxy('move', e)
}, false);
@maggocnx
maggocnx / amazon.js
Last active August 29, 2015 14:21
Scraping Amazon Orders German
var casper = require('casper').create({ pageSettings: { webSecurityEnabled: false }});
casper.userAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)');
var numberOfOrders = 0;
casper.on('remote.message', function(msg) {
if(msg.indexOf(">")== 0){
this.echo(msg);