nano


Source link: https://github.com/bulldog2011/nano

## DISCLAIMER

This library is still under construction. Beta testers are more than welcome.

Nano

A light Web Service client framework targeting Android platform

##Feature Highlight

  1. Support WSDL driven development, code generator tool is provided to auto-genearte strongly typed proxy from WSDL.
  2. Support SOAP 1.1/1.2 and XML based web service.
  3. Support automatic SOAP/XML to Java object binding, performance is comparable to Android native XML parser.
  4. Built on popular and mature loopj async http client library for Android.
  5. Has been verified with industrial grade Web Service like Amazon ECommerce Web Serivce and eBay Finding/Shopping/Trading Web Service.
  6. Support asynchronous service invocation, flexible HTTP/SOAP header setting, timeout setting, encoding setting, logging, etc.
  7. Light-weight, the library jar is less than 150K, no external dependencies on Android platform.
  8. Besides Web Service, can also be used as a standalone XML and JSON binding framework.

The Big Picture

##How to Use You have a few options:

  1. Direct jar reference
    Download latest 0.7.0 release

  2. Include the whole source of Nano into your project

  3. Maven reference

 <dependency>
 <groupId>com.leansoft</groupId>
 <artifactId>nano</artifactId>
 <version>0.7.0</version>  </dependency>
 <repository>
 <id>github.release.repo</id>
 <url>https://raw.github.com/bulldog2011/bulldog-repo/master/repo/releases/</url>  </repository>

After including Nano into your project, please make sure to add following user permissions in the AndroidManifest.xml file for network access:

 <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

##WSDL Driven Development Flow

  1. Generate Java proxy from WSDL
  2. Create new Android project, add Nano runtime and generated proxy into your project
  3. Implement appliction logic and UI, call proxy to invoke web service as needed.

##Example Usage After the service proxy is generated from wsdl, service invocation through Nano runtime is extremely simple:

 // Get shared client  NumberConversionSoapType_SOAPClient client = NumberConversionServiceClient.getSharedClient();
  client.setDebug(true);
 // enable soap message logging
 // build request  NumberToWords request = new NumberToWords();
  try {

String number = ((EditText)findViewById(R.id.numerInputText)).getText().toString();

request.ubiNum = new BigInteger(number);
  
}
 catch (NumberFormatException ex) {

Toast.makeText(MainActivity.this, "Invalid integer number", Toast.LENGTH_LONG).show();

return;  
}

 client.numberToWords(request, new SOAPServiceCallback<NumberToWordsResponse>() {

 @Override
public void onSuccess(NumberToWordsResponse responseObject) {
 // success
 Toast.makeText(MainActivity.this, responseObject.numberToWordsResult, Toast.LENGTH_LONG).show();

}

 @Override
public void onFailure(Throwable error, String errorMessage) {
 // http or parsing error
 Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_LONG).show();

}

 @Override
public void onSOAPFault(Object soapFault) {
 // soap fault
 Fault fault = (Fault)soapFault;
 Toast.makeText(MainActivity.this, fault.faultstring, Toast.LENGTH_LONG).show();

}

  
}
);
 

Web Service Sample List

All samples are in the sample folder, following samples are included:

##Docs for Web Service

  1. WSDL Driven Development on Android - the Big Picture
  2. Nano Tutorial 1 - a Number Conversion Sample
  3. Nano Tutorial 2 - a BarCode Generator Sample
  4. Nano Tutorial 3 - Hello eBay Finding Service
  5. Nano Tutorial 4 - Hello eBay Shopping Service
  6. Nano Tutorial 5 - Hello Amazon Product Advertising API

##Docs for Binding

  1. Nano Hello World
  2. Nano List Handling
  3. Nano Compare to JAXB
  4. Scheam driven data binding with Nano and mxjc
  5. Xml Parser and Nano Benchmark on Android
  6. Nano on Android Tutorial 1
  7. A full movie search Android application using Nano binding
  8. Schema Driven Web Serivce Client Development on Android, Part 1 : Hello eBay Finding
  9. Schema Driven Web Serivce Client Development on Android, Part 2 : eBay Search App

##Mapping between XML Schema Types and Java Types

XML Schema Data TypesObjective-C Data Types
xsd:base64Binary byte[]
xsd:boolean boolean
xsd:byte byte
xsd:date java.util.Date
xsd:dateTime java.util.Date
xsd:decimal java.math.BigDecimal
xsd:double double
xsd:duration com.leansoft.nano.custom.types.Duration
xsd:float float
xsd:g java.util.Date
xsd:hexBinary byte[]
xsd:int int
xsd:integer java.lang.BigInteger
xsd:long long
xsd:NOTATION javax.xml.namespace.QName
xsd:Qname javax.xml.namespace.QName
xsd:short short
xsd:string java.lang.String
xsd:time java.util.Date
xsd:unsignedByte short
xsd:unsignedInt long
xsd:unsignedShort int

Version History

0.7.0 - April 14, 2013 repository

  • Initial release supporting SOAP/XML Web Service.

##Compatibility Nano has been verified with Android 2.2(API 8) and 2.3.6(API 10), Nano should work without problem on Android 2.2 and above although this hasn't been verified formally.

##Current Limitation

  1. Only Document/Literal style Web Service is support, RPC style Web Serivice is not supported.
  2. SOAP attachment is not supported

###Copyright and License Copyright 2012 LeanSoft, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Resources

Titanic is an Android experiment reproducing this effect:

Layout inflation library for Android which uses annotation processing to write the code you don't want to write and simplify your compound views.

Use the annotation @AfterInflate on your compound view's methods you want to run straight after the layout is inflated with Michelangelo.

TextChronometer is a very simple library offering a widget showing a live time formatted like "4 seconds ago": This library is very convenient if you are building apps with a live timeline.

A TextView that simulates the effect from the app Secret where the characters fade in/out at different speeds.

An animated path view following the methods in a blog post.

A highly configurable section based layout manager with headers and all that.

Features:

  • Section Headers
    • Sticky headers
    • Headers in content margins
    • Header overlays
  • Individual layouts for each section at the same time
    • Linear
    • Grid not yet implemented
    • Staggered Grid not yet implemented

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes