Here is a simple way to use ADB over wifi with your device. Make sure that ADB can reach your device over the network.
-
Connect device to usb
-
Restart the ADB daemon to listening on TCP port
adb tcpip 5555
private ImageView imageView; | |
// ... | |
public void onDoingSomethingGood() { | |
new Thread(new Runnable() { | |
public void run() { | |
final Bitmap bitmap = loadImageFromOutside("http://mycloud.com/image.png"); | |
imageView.post(new Runnable() { | |
public void run() { | |
imageView.setImageBitmap(bitmap); |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 | |
http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.example.android</groupId> | |
<artifactId>my-android-library</artifactId> | |
<version>0.1</version> | |
<packaging>apklib</packaging> | |
<name>my-android-library</name> |
-- Remove the history from | |
rm -rf .git | |
-- recreate the repos from the current content only | |
git init | |
git add . | |
git commit -m "Initial commit" | |
-- push to the github remote repos ensuring you overwrite history | |
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git |
public static float convertPixelsToDp(float px){ | |
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics(); | |
float dp = px / (metrics.densityDpi / 160f); | |
return Math.round(dp); | |
} | |
public static float convertDpToPixel(float dp){ | |
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics(); | |
float px = dp * (metrics.densityDpi / 160f); | |
return Math.round(px); |
/* | |
This is using the JS port of Google's libphonenumber. | |
As far as I know, though, all of the APIs are the same or similar | |
*/ | |
// I just hardcoded "US" as the country, but of course you can use any country iso code | |
var ctry = 'US'; | |
var exampleNumber = i18n.phonenumbers.PhoneNumberUtil.getInstance() | |
.getExampleNumberForType(ctry, i18n.phonenumbers.PhoneNumberType.MOBILE); // returns PhoneNumber instance |
# Use ADB to find and pull an Android package from device | |
adb shell pm list packages | |
adb shell pm path com.package | |
adb pull /data/app/com.package.app.apk | |
# With APK local, can now adb push to device and run it | |
# Use tcpdump to log traffic to mon.txt | |
sudo tcpdump -A dst port 80 > mon.txt |
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip | |
# under public domain terms | |
country_bounding_boxes = { | |
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)), | |
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)), | |
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)), | |
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)), | |
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)), | |
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)), |
package main | |
import ( | |
"fmt" | |
"net" | |
"io" | |
) | |
func main() { | |
//http.HandleFunc("/", handler) |
Naming file |