Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on March 21, 2013 19:47:46    Last update: March 22, 2013 12:30:27
It's normal practice to import types from an external xsd file in WSDL like this: <wsdl:types> <xsd:schema xmlns:xsd="htt... When you use <dynamic-wsdl> and have Commons XMLSchema on the class path, Spring-WS inlines the xsd in the wsdl. But that doesn't happen when you use <static-wsdl> . You can define a SimpleXsdSchema bean to expose the xsd: <?xml version="1.0" encoding="UTF-8"?> <beans x... where the bean id "hello" should match the schemaLocation attribute in the WSDL (without the .xsd suffix). But note that the SimpleXsdSchema does not inline the xsd. It only makes the xsd available via an HTTP URL. Alternatively, you can simply put the xsd file under the content directory of the webapp (just link any CSS or JavaScript). Anyway, that's a lot of manual...
Created by Dr. Xi on February 23, 2012 14:07:40    Last update: June 25, 2012 13:40:44
The command " svn info " prints information about the current directory: $ svn info Path: . URL: http://svn.example.c... where: Revision: is the last syncup (update) revision of the current TARGET (artifact/file/directory, whatever you call). This number bumps up to that of the current project revision number after you do an update. Last Changed Rev: is the revision number of the latest change for the current TARGET . If TARGET is a directory, it is the revision number of the latest change within the directory, including all subdirectories. However , this number is not accurate after you do a check in without a following update . The revision number for the file or directory you checked in will have higher revision number than its parent/ancestor....
Created by lokf on January 13, 2012 14:10:42    Last update: January 13, 2012 14:10:42
For some reason I don't know writing to files in Android is very complicated and tedious. Here is some code for those who might need it. Apps should write in the SD in the directory /Android/data/package_name/files/ so that it is deleted with the app uninstall. package randomname; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.nio.ByteBuffer; import android.content.Context; import android.os.Environment; import android.util.Log; public class FileIOLibrary { String packageName; boolean mExternalStorageAvailable = false; boolean mExternalStorageWriteable = false; FileIOLibrary(String packageNamep) { this.packageName=packageNamep; } public boolean isExternalStorageAvailable() { updateExternalStorageState(); return mExternalStorageAvailable; } public boolean isExternalStorageWritable() { updateExternalStorageState(); return mExternalStorageWriteable; } /** * writes the current state of SD card to the corresponding variables */ void updateExternalStorageState() {...
Created by woolf on December 29, 2011 11:18:11    Last update: December 29, 2011 11:18:11
Use the expand command to extract files from a .cab file: expand [-r] source [destination] [-d source.cab ... Option Description [-r] Renames expanded files. [destination] Specifies where files are to be expanded. If source is multiple files and -r is not specified, destination must be a directory. destination can consist of a drive letter and colon, a directory name, a file name, or a combination of any of these. [-d source.cab] Displays a list of files in the source location. Does not expand or extract the files. [-f:files] Specifies the files in a cabinet (.cab) file that you intend to expand. You can use wildcards (* and ?). source.cab Specifies the files to expand. source can consist of a drive letter and colon, a directory...
Created by Dr. Xi on December 07, 2011 13:41:15    Last update: December 07, 2011 13:41:15
To view change history of the current directory: $ svn log To view change history of README.txt : $ svn log some/path/README.txt To view change history of README.txt since revision 733: $ svn log README.txt -r 733:HEAD To view change history of README.txt since revision Dec 07, 2011: $ svn log README.txt -r {'2011-12-07'}:HEAD
Created by freyo on July 21, 2011 12:58:59    Last update: July 21, 2011 13:02:17
From Android Developers : You can use a third party JAR in your application by adding it to your Eclipse project as follows: In the Package Explorer panel, right-click on your project and select Properties . Select Java Build Path , then the tab Libraries . Press the Add External JARs... button and select the JAR file. Alternatively, if you want to include third party JARs with your package, create a new directory for them within your project and select Add Library... instead. It is not necessary to put external JARs in the assets folder. Apparently, this is not working for me! I added a libs folder, put the external jar in libs . The project built fine, but the APK does not include the...
Created by freyo on April 01, 2011 14:29:25    Last update: June 29, 2011 13:58:27
Start the emulator ( create an AVD if none exists) $ tools/emulator -avd Simple8 Create new project $ tools/android create project \ > --package co... where " --target 2 " identifies the target platform as displayed by " tools/android list targets ", which is stored in the properties file default.properties in the project root folder. cd HelloWorld and install debug package onto the running emulator: $ ant install Buildfile: build.xml [set... Launch the Hello World application on the emulator. You'll see something like this: Edit res/values/string.xml , change the contents to: <?xml version="1.0" encoding="utf-8"?> <resourc... Edit res/layout/main.xml , change the contents to: <?xml version="1.0" encoding="utf-8"?> <LinearL... The contents of the text area now refer to a string defined in the resource file strings.xml , instead...
Created by Dr. Xi on June 16, 2011 13:51:53    Last update: June 16, 2011 14:02:10
With an absolute path to a file, this is the way to construct a URL : URL url = new URL("file:///absolute/path/to/file.e... What if I want a URL for a file relative to the current working directory? URL url = new URL("file:///./file.ext"); // this ... Or, you can use the File class to help you out: URL url = new URL(String.format("file:///%s/file.e...
Created by freyo on May 17, 2011 11:13:17    Last update: May 17, 2011 11:13:17
This is an odd-ball content provider in that it doesn't provide database records, but provides a resource as a stream. It can be used to provide media files or XML resources. Start the project with: tools/android create project --package com.android... Create assets directory and add an XML file ( assets/demo.xml ): <? xml version="1.0" encoding="UTF-8"?> <people... Edit the layout ( res/layout/main.xml ): <?xml version="1.0" encoding="utf-8"?> <LinearL... Edit src/com/android/cptest/Dummy.java : package com.android.cptest; import java.io.... Add content provider ( src/com/android/cptest/XmlResource.java ): package com.android.cptest; import java.io.... Update AndroidManifest.xml : <?xml version="1.0" encoding="utf-8"?> <manifes... Add this section to the end of build.xml : <target name="-package-resources"> <ech... Build and install: ant install Screenshot: Remove the Dummy activity ( AndroidManifest.xml ): <?xml version="1.0" encoding="utf-8"?> <manifes... Create a new project for...
Created by freyo on April 12, 2011 15:13:32    Last update: May 03, 2011 15:20:55
Create new project $ tools/android create project \ > --package co... Edit res/values/string.xml , add strings for the main screen. <?xml version="1.0" encoding="utf-8"?> <resourc... Add widgets to main layout ( res/layout/main.xml ). <?xml version="1.0" encoding="utf-8"?> <LinearL... Edit src/com/android/apkinfo/GetAPKPermissions.java and change contents to: package com.android.apkinfo; import android... Install the debug package to the emulator: ant install The screen should look like: Add display permissions activity. Start by creating a new layout res/layout/display_permissions.xml : <?xml version="1.0" encoding="utf-8"?> <LinearL... Add the strings used by the new Activity ( res/values/strings.xml ): <?xml version="1.0" encoding="utf-8"?> <resourc... Add the Display Permissions Activity ( src/com/android/apkinfo/DisplayPermissions.java ): package com.android.apkinfo; import android... Change src/com/android/apkinfo/GetAPKPermissions.java to invoke the Display Permissions Activity: package com.android.apkinfo; import android... Declare Display Permissions Activity in AndroidManifest.xml : <?xml version="1.0" encoding="utf-8"?> <manifes......
Previous  1 2 3 Next