Skip to content

Commit 518856a

Browse files
[Android] Update readme for newer android project template (#708)
* fix android readme to account for newer template versions * spacing * Updating package version --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0a2c1fd commit 518856a

File tree

2 files changed

+41
-82
lines changed

2 files changed

+41
-82
lines changed

README.md

Lines changed: 40 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -82,88 +82,47 @@ The release can be found here: https://github.com/ApryseSDK/pdftron-react-native
8282

8383
1. Add the following in your `android/app/build.gradle` file:
8484

85-
```diff
86-
android {
87-
ndkVersion rootProject.ext.ndkVersion
85+
```diff
86+
defaultConfig {
87+
applicationId "com.example.myapp"
88+
minSdkVersion rootProject.ext.minSdkVersion
89+
targetSdkVersion rootProject.ext.targetSdkVersion
90+
versionCode 1
91+
versionName "1.0.0"
92+
93+
+ resValue("string", "PDFTRON_LICENSE_KEY", "\"LICENSE_KEY_GOES_HERE\"")
94+
}
95+
```
8896

89-
compileSdkVersion rootProject.ext.compileSdkVersion
90-
91-
defaultConfig {
92-
applicationId "com.reactnativesample"
93-
minSdkVersion rootProject.ext.minSdkVersion
94-
targetSdkVersion rootProject.ext.targetSdkVersion
95-
versionCode 1
96-
versionName "1.0"
97-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
98-
+ multiDexEnabled true
99-
+ manifestPlaceholders = [pdftronLicenseKey:PDFTRON_LICENSE_KEY]
100-
}
101-
...
102-
}
103-
...
104-
105-
dependencies {
106-
+ implementation "androidx.multidex:multidex:2.0.1"
107-
...
108-
}
109-
```
110-
111-
2. In your `android/gradle.properties` file, add the following line:
112-
```diff
113-
# Add the PDFTRON_LICENSE_KEY variable here.
114-
# For trial purposes leave it blank.
115-
# For production add a valid commercial license key.
116-
PDFTRON_LICENSE_KEY=
117-
```
118-
3. Add the following to your `android/app/src/main/AndroidManifest.xml` file:
119-
120-
```diff
121-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
122-
package="com.myapp">
123-
124-
<uses-permission android:name="android.permission.INTERNET" />
125-
<!-- Required to read and write documents from device storage -->
126-
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
127-
<!-- Required if you want to record audio annotations -->
128-
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
129-
130-
<application
131-
...
132-
+ android:largeHeap="true"
133-
+ android:usesCleartextTraffic="true">
134-
135-
<!-- Add license key in meta-data tag here. This should be inside the application tag. -->
136-
+ <meta-data
137-
+ android:name="pdftron_license_key"
138-
+ android:value="${pdftronLicenseKey}"/>
139-
140-
<activity
141-
...
142-
- android:windowSoftInputMode="adjustResize"
143-
+ android:windowSoftInputMode="adjustPan"
144-
+ android:exported="true">
145-
<intent-filter>
146-
<action android:name="android.intent.action.MAIN" />
147-
<category android:name="android.intent.category.LAUNCHER" />
148-
</intent-filter>
149-
</activity>
150-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
151-
</application>
152-
</manifest>
153-
```
154-
155-
4. In your `android/app/src/main/java/com/myapp/MainApplication.java` file, change `Application` to `MultiDexApplication`:
156-
157-
```diff
158-
- import android.app.Application;
159-
+ import androidx.multidex.MultiDexApplication;
160-
...
161-
- public class MainApplication extends Application implements ReactApplication {
162-
+ public class MainApplication extends MultiDexApplication implements ReactApplication {
163-
```
164-
165-
5. Replace `App.js` (or `App.tsx`) with what is shown for [NPM](#Usage-NPM) or [GitHub](#Usage-Github)
166-
6. Finally in the root project directory, run `react-native run-android`.
97+
2. Add the following to your `android/app/src/main/AndroidManifest.xml` file:
98+
99+
```diff
100+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
101+
package="com.example.myapp">
102+
103+
<!-- Required if you want to work with online documents -->
104+
+ <uses-permission android:name="android.permission.INTERNET" />
105+
<!-- Required if you want to record audio annotations -->
106+
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
107+
108+
<application
109+
...
110+
+ android:largeHeap="true">
111+
112+
<!-- Add license key in meta-data tag here. This should be inside the application tag. -->
113+
+ <meta-data
114+
+ android:name="pdftron_license_key"
115+
+ android:value="@string/PDFTRON_LICENSE_KEY" />
116+
...
117+
<activity
118+
...
119+
- android:windowSoftInputMode="adjustResize"
120+
+ android:windowSoftInputMode="adjustPan">
121+
</activity>
122+
```
123+
124+
3. Replace `App.js` (or `App.tsx`) with what is shown for [NPM](#Usage-NPM) or [GitHub](#Usage-Github)
125+
4. Finally in the root project directory, run `react-native run-android`.
167126
168127
### iOS
169128

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-pdftron",
33
"title": "React Native Pdftron",
4-
"version": "3.0.4-17",
4+
"version": "3.0.4-18",
55
"description": "React Native Pdftron",
66
"main": "./lib/index.js",
77
"typings": "index.ts",

0 commit comments

Comments
 (0)