You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StringExtractor is used to extracts raw strings from a java and xml files of Android apps project to a optional xml file and link them<b>
3
-
# Usage
4
-
This is a sample code to extracts the strings from JavaFile.java and save to myapp_strings.xml
2
+
StringExtractor is used to extracts raw strings from a java and xml files of Android apps project to a optional xml file and link them
3
+
##Usage
4
+
This is a sample code to extracts the strings from JavaFile.java and save to myapp_strings.xml
5
5
```java
6
6
File inputFile =newFile("JavaFile.java");
7
7
File xmlFile =newFile("myapp_strings.xml");
@@ -14,18 +14,18 @@ try{
14
14
//handle errors here
15
15
}
16
16
```
17
-
as we set backupFile to true the file JavaFile.java will be renamed to JavaFile.java.backup before writing the modified code to JavaFile.java<br>the file ```ExtractedString.java``` will be created at the same directory of inputFile.<br>every non blank string will be replaced with ```getResources().getString(R.string.myapp_string%s)``` or ```ExtractedString.getString(R.string.myapp_string%s)``` if ```extractedString=true```.<br>while %s is replaced with the number from 1 to total strings found.
18
-
# Command Line
19
-
firstly compile the file using
17
+
Because we set backupFile to true the file JavaFile.java will be renamed to JavaFile.java.backup before writing the modified code to JavaFile.java<br>the file ```ExtractedString.java``` will be created at the same directory of inputFile.<br>every non blank string will be replaced with ```getResources().getString(R.string.myapp_string%s)``` or ```ExtractedString.getString(R.string.myapp_string%s)``` if ```extractedString=true```.<br>while %s is replaced with the number from 1 to total strings found.
18
+
##Command Line
19
+
firstly compile the file using
20
20
```
21
-
javadoc StringExtractor.java
22
-
```
23
-
and then executes with
21
+
javac StringExtractor.java
24
22
```
23
+
and then executes with
24
+
<pre>
25
25
java StringExtractor -[r|b|c] -i FILE -d PATH -p TEXT -s TEXT -x FILE
26
-
```
27
-
-Options are:
28
-
```
26
+
</pre>
27
+
Options are:
28
+
<pre>
29
29
-i FILE the single xml or java file to scan the string. options [-d,-r] are ignore if specified.
30
30
-d PATH directory to scan for xml or java files. this option require -r to work.
31
31
-p TEXT the prefix text to use when genarating xml string name.
@@ -35,5 +35,6 @@ java StringExtractor -[r|b|c] -i FILE -d PATH -p TEXT -s TEXT -x FILE
35
35
-b backup the original file to filename.backup .
36
36
-c use class ExtractedString for java files. this will generate java file 'ExtractedString.java' in the same directory of input file to access strings from classes that do not have a Context. and you must call ExtractedString.setContext(context) from your application or activity onCreate.
37
37
-h show this usage message.
38
-
```
38
+
</pre>
39
+
39
40
> Note: StringExtractor is only for android apps project.
0 commit comments