# mobile-toolkit **Repository Path**: mirrors/mobile-toolkit ## Basic Information - **Project Name**: mobile-toolkit - **Description**: Mobile toolkit for java. Include apple push notification, in app pay validate and some amazon aws tools - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: https://www.oschina.net/p/mobile-toolkit - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-04-02 - **Last Updated**: 2026-02-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **overview** This toolkit is for networking mobile application develop . We often need to use apple's push notification service and in app pay service , and some application may use amazon's aws service. I found there is no simple and easy way to use this service, so i create this toolkit,It just wrap the really sdk for this service , such as wrap [JAVAPNS](http://code.google.com/p/javapns) for apns,but make it more simple and more easy . Enjoy it! ## feature 1. APNS Apple push notification service


    
       //setup apns by your keystore, key password and production ,false will use sandbox env
        ApnsTools apnsTools = new DefaultApnsTools("aps.p12", "password", false);
        apnsTools.alert("message", "device token");
        
        //async apns , should set async thread number
        AsyncApnsTools asyncApnsTools = new DefaultAsyncApnsTools("aps.p12", "password", false, 12);
        asyncApnsTools.alert("message", "device token");

        // you can setup a monitor for async apns tool.such as log monitor for print push result log. 2 is the log interval. TimeUnit is second
        AsyncNotificationMonitor monitor = new LogNotificationMonitor(2, asyncApnsTools);

Suggest config this in spring: 2. IAP Apple in app pay

 	   //Setup iap tools,  false will use sandbox env 
        IapTools iapTools = new DefaultIapTools(false);
        IapReceipt receipt = iapTools.validate("your pay receipt");
        System.out.print(receipt.getStatus());
 
Suggest config this in spring: 3. AWS S3 Amazon s3
 
        AwsS3Tools s3Tools = new DefaultS3Tools("your accessKey", "your accessSecret");
        String url  = s3Tools.upload("bucket", "key", new byte[]{}, "image/png");
        System.out.print(url); 
  
Suggest config this in spring: 4. AWS Mail Amazon mail
 
    AwsMailTools mailTools = new DefaultMailTools("your accessKey", "your accessSecret", "your admin mail");
    mailTools.sendMail("to address", "title", "body");
Suggest config this in spring: ## install You can use this by maven. At first should add repository: 51APP 3RD 51APP 3RD http://51app.mobi:8081/nexus/content/repositories/thirdparty/ 51APP RELEASE 51APP RELEASE http://51app.mobi:8081/nexus/content/repositories/releases/ then add dependency: mobi.51app mobile-toolkit 1.0 ## dependency Because this toolkit just a simple wrap, so it needs some dependency . com.google.guava guava 10.0.1 // logback org.slf4j slf4j-api 1.6.5 ch.qos.logback logback-core 1.0.6 ch.qos.logback logback-classic 1.0.6 // for apns javapns javapns 2.2 log4j log4j 1.2.16 org.bouncycastle bcprov-jdk16 1.46 //for in app pay org.codehaus.jackson jackson-mapper-asl 1.9.5 com.ning async-http-client 1.6.5 // for aws mail ans aws s3 com.amazonaws aws-java-sdk 1.3.11 org.springframework spring-core 3.0.5.RELEASE org.springframework spring-context 3.0.5.RELEASE org.springframework spring-context-support 3.0.5.RELEASE javax.mail mailapi 1.4.3 cglib cglib 2.2