- Token-1 | Trying to connect the server;
- If Token-1 is not already connected | Token is not found in users[] array list;
- Create a user object with token and connection id and push to users[] array list;
- Complete the flow.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void sendLongSMS() { | |
String ussdCode = "#456#"; | |
Intent intent = new Intent(Intent.ACTION_CALL); | |
intent.setData(ussdToCallableUri(ussdCode)); | |
try { | |
startActivity(intent); | |
} catch (SecurityException e) { | |
e.printStackTrace(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void setDeviceName(String devName) { | |
try { | |
Class[] paramTypes = new Class[3]; | |
paramTypes[0] = WifiP2pManager.Channel.class; | |
paramTypes[1] = String.class; | |
paramTypes[2] = WifiP2pManager.ActionListener.class; | |
Method setDeviceName = manager.getClass().getMethod("setDeviceName", paramTypes); | |
setDeviceName.setAccessible(true); | |
Object arglist[] = new Object[3]; | |
arglist[0] = channel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.graphics.Bitmap; | |
import android.graphics.PixelFormat; | |
import android.graphics.Point; | |
import android.hardware.display.DisplayManager; | |
import android.hardware.display.VirtualDisplay; | |
import android.media.Image; | |
import android.media.ImageReader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.ProgressDialog; | |
import android.content.Context; | |
import android.os.AsyncTask; | |
import java.io.BufferedInputStream; | |
import java.io.FileOutputStream; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.net.URL; | |
import java.net.URLConnection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = require('express')() | |
const http = require('http').Server(app) | |
const io = require('socket.io')(http) | |
// Initialization | |
const session_handler = require('io-session-handler').from(io) | |
/** | |
* Connection returns - Token, ID and the Status (1 - connected, 0 - Disconnected) | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.security.KeyManagementException; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.cert.CertificateException; | |
import java.security.cert.X509Certificate; | |
import javax.net.ssl.HostnameVerifier; | |
import javax.net.ssl.SSLContext; | |
import javax.net.ssl.SSLSession; | |
import javax.net.ssl.TrustManager; | |
import javax.net.ssl.X509TrustManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nano /etc/udev/rules.d/51-android.rules | |
sudo udevadm control --reload-rules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Notification; | |
import android.app.NotificationChannel; | |
import android.app.NotificationManager; | |
import android.app.PendingIntent; | |
import android.app.Service; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.os.Binder; |