- Details
- Written by: Stanko Milosev
- Category: Android
- Hits: 1646
Sports Tracker
OpenVPN Connect
Remote Desktop 8
Komoot
Shazam
TubeMate
Equalizer + Pro
TeamViewer
VLC
Contacts
Google Calendar
Microsoft Teams
Google Home
Solid Explorer File Manager
- Details
- Written by: Stanko Milosev
- Category: Android
- Hits: 3714
Recently I had a problem that I needed to send some text from Android over webview to JavaScript, but with new lines included, problem was that webview didn't respect \r\n.
This is my solution:
... receivedPacket = new DatagramPacket(buf, buf.length); ... final String strReceivedPacket = new String(receivedPacket.getData(), 0, receivedPacket.getLength()).replaceAll("\r\n", "\\\\r\\\\n");
- Details
- Written by: Stanko Milosev
- Category: Android
- Hits: 4400
Just a few comments on my investigation about building and installing Android application.
In Linux go to root folder of your application and write something like:
./gradlew build
build means build.gradle actually, or something like ./gradlew assembleDebug, with that you will build application with debug type. Check the source in /app/build.gradle.
After building we can install application with command like:
Where:
-d Direct an adb command to the only attached USB device.
-r Reinstall an exisiting app, keeping its data.
- Details
- Written by: Stanko Milosev
- Category: Android
- Hits: 4175
For example we have view:
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:background="@drawable/black"/>
Notice line:
android:background="@drawable/black"
This means that I've created new file in drawable folder /app/src/main/res/drawable/black.xml which looks like:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#ffffff" /> <stroke android:width="1dip" android:color="#000000"/> </shape>