, , , .
, , . , .
apk Android APK Builder 1.1.0. , .
Android, , .
Res layout β XML , , . , HTML - . .
β , colors.xml, strings.xml, styles.xml. .
drawable β pics {jpeg, png,...}; .
mipmap β . ?
xml β xml .
src β JavaScript html. , java . layout.xml, html.
AndroidManifest.xml β . , , .. Android . , .
4 Android: , , . , . ; .
gradle apk-. APK Builder Android. .
, Android, .
, . :
- NumPad
- AndroidManifest.xml
- Saragch
- NUM_PAD
- MyInputMethodService.java
- location
- key_preview.xml
- keyboard_view.xml
- XML
- values
- colors.xml
- strings.xml
- styles.xml
, ide, Android Studio, .
- .
A: NumPad/res/layout/key_preview.xml
<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:background="@android:color/white" android:textColor="@android:color/black" android:textSize="30sp"> </TextView>
B: NumPad/res/layout/keyboard_view.xml
<?xml version="1.0" encoding="utf-8"?> <android.inputmethodservice.KeyboardView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/keyboard_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:keyPreviewLayout="@layout/key_preview" android:layout_alignParentBottom="true"> </android.inputmethodservice.KeyboardView>
C: NumPad/res/xml/method.xml
<?xml version="1.0" encoding="utf-8"?> <input-method xmlns:android="http://schemas.android.com/apk/res/android"> <subtype android:imeSubtypeMode="keyboard"/> </input-method>
D: Numpad/res/xml/number_pad.xml
<?xml version="1.0" encoding="utf-8"?> <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="20%p" android:horizontalGap="5dp" android:verticalGap="5dp" android:keyHeight="60dp"> <Row> <Key android:codes="49" android:keyLabel="1" android:keyEdgeFlags="left"/> <Key android:codes="50" android:keyLabel="2"/> <Key android:codes="51" android:keyLabel="3"/> <Key android:codes="52" android:keyLabel="4"/> <Key android:codes="53" android:keyLabel="5" android:keyEdgeFlags="right"/> </Row> <Row> <Key android:codes="54" android:keyLabel="6" android:keyEdgeFlags="left"/> <Key android:codes="55" android:keyLabel="7"/> <Key android:codes="56" android:keyLabel="8"/> <Key android:codes="57" android:keyLabel="9"/> <Key android:codes="48" android:keyLabel="0" android:keyEdgeFlags="right"/> </Row> <Row> <Key android:codes="-5" android:keyLabel="DELETE" android:keyWidth="40%p" android:keyEdgeFlags="left" android:isRepeatable="true"/> <Key android:codes="10" android:keyLabel="ENTER" android:keyWidth="60%p" android:keyEdgeFlags="right"/> </Row> </Keyboard>
, . .
, Android Studio; . , APK Builder.
E: NumPad/res/values /colors.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">#3F51B5</color> <color name="colorPrimaryDark">#303F9F</color> <color name="colorAccent">#FF4081</color> </resources>
F: NumPad/res/values /strings.xml
<resources> <string name="app_name">Suragch NumPad</string> </resources>
G: NumPad/res/values /styles.xml
<resources> <style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar"> </style> </resources>
H: Numpad/AndroidManifest.xml
, . , . . . Suracgh, , . , Android. - . numpad ! .
. , ! xmlns: android -sdk; . , .
, , . service.android:name java . . package - , java .
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="Saragch.num_pad"> <uses-sdk android:minSdkVersion="12" android:targetSdkVersion="27" /> <application android:allowBackup="true" android:icon="@drawable/Suragch_NumPad_icon" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <service android:name=".MyInputMethodService" android:label="Keyboard Display Name" android:permission="android.permission.BIND_INPUT_METHOD"> <intent-filter> <action android:name="android.view.InputMethod"/> </intent-filter> <meta-data android:name="android.view.im" android:resource="@xml/method"/> </service> </application> </manifest>
: NumPad/src/Saragch/num_pad/MyInputMethodService.java
: , Java src.
, , . , Java , , , . xml Android!
, ! , "" , , ! InputMethodService, Keyboard .. , . , , , ?
. , , , .
package Saragch.num_pad; import android.inputmethodservice.InputMethodService; import android.inputmethodservice.KeyboardView; import android.inputmethodservice.Keyboard; import android.text.TextUtils; import android.view.inputmethod.InputConnection; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; public class MyInputMethodService extends InputMethodService implements KeyboardView.OnKeyboardActionListener { @Override public View onCreateInputView() {
.
, Android. , , .
, Gradle apk. apk jar rar zip . . , .
, . . , .