기본 콘텐츠로 건너뛰기

글

javascript callback proxy

function proxyCallback(callback) {       return function (res) {         if (res.status < 200 && res.status >= 300) {           return callback(res.status, res.data.error);         }         return callback(null, res.data);       }     }     function posts_list(callback) {       var req = {         method: 'GET',         url: '/api/1/posts'       };       $http(req).then(proxyCallback(callback));     }

android webview post data

호출 순서 1. javascript 에서 post 할 데이터를 plugin 으로 보낸다. { "username":"홍길동" , "userpassword":"" } 2. 이 데이터를 안드로이드 플러그인에서 string 으로 만든 후 , Json Object 로 보낸다. String postData = "username="+  URLEncoder . encode ( username, "UTF-8" ); String params =  Base64.encodeToString(params.getBytes(), Base64.URL_SAFE); 3.WebView 호출하는데서는 2번에서 암호화 한 값을 풀어서, byte[] 로 보낸다. String tmp = new String(Base64.decode( params , Base64. URL_SAFE )); String url = "http://www.example.com" ; String postData = "username=my_username&password=my_password" ; webview . postUrl ( url , EncodingUtils . getBytes ( postData , "BASE64" )); 위와 같이 보낸다.

ant task email example

ant installjars ant email <?xml version="1.0" encoding="UTF-8"?> <project name="SplashActivity" default="help"> <target description="Generates and send junit test reports" name="email"> <mail mailhost="smtp.gmail.com" enableStartTLS="true" mailport="465" password="*******" ssl="true" subject="1Q Transfer APK" user="kildongp@gmail.com" cclist="labj0812@gmail.com,wanna88@empal.com,amour10@daum.net" > <from address="amour10@finger.co.kr"></from> <replyto address="amour10@finger.co.kr"></replyto> <to address="bongfish@finger.co.kr"></to> <message>1Q 뱅킹이 성공적으로 빌드 되었습니다.</message> <attachments> <fileset dir="./bin"> <include name="**/*debug.a...

mac svn this client is too old to work with working copy

executng ant task svn  < target name = "svnversion" >     < exec executable = "svnversion" outputproperty = "svnversion" />     < echo message = "SVN Version: ${svnversion}" /> </ target > ------------------------------------------------------------------------ svnversion :      [ exec ] Result: 1      [ echo ] SVN Version: svn: E155021: This client is too old to work with the working copy at      [ echo ] '/Users/hongsangbeom/Documents/workspace-kjb/OrchestraFrameworkAndroid_kjb' (format 31).      [ echo ] You need to get a newer Subversion client. For more details, see      [ echo ]   http://subversion.apache.org/faq.html#working-copy-format-change os: osx svn client too old, i should update svn client. svn --version -------------------------------- svn, version 1.7.19 (r1643991) t...

allow ajax header in Android webview and ios uiwebview

my application is hybrid app. both android and ios works. local contents is loaded in apps. and add additional headers ajax server call. In my work around , server modification not allowed. local-content ajax add header. (ref http://stackoverflow.com/questions/3258645/pass-request-headers-in-a-jquery-ajax-get-call ) $ . ajax ({ url : "/test" , headers : { "X-Test-Header" : "test-value" } }); Android webview setting ( ref : http://stackoverflow.com/questions/8648616/webview-javascript-cross-domain-from-a-local-html-file ) Initialize your WebView: WebView _webView = ( WebView ) this . findViewById ( R . id . id_of_your_webview_in_layout ); get WebView settings: WebSettings settings = _webView . getSettings (); set following settings: settings . setJavaScriptEnabled ( true ); settings . setAllowFileAccessFromFileURLs ( true ); //Maybe you don't need this rule settings . setAllowUniversalAccessFromFileUR...

install eclipse jslint plugin

1.install adt plugin Download the ADT Plugin To add the ADT plugin to Eclipse: Start Eclipse, then select  Help  >  Install New Software . Click  Add , in the top-right corner. In the Add Repository dialog that appears, enter "ADT Plugin" for the  Name  and the following URL for the  Location : https : //dl-ssl.google.com/android/eclipse/ Note:  The Android Developer Tools update site requires a secure connection. Make sure the update site URL you enter starts with HTTPS. Click  OK . In the Available Software dialog, select the checkbox next to Developer Tools and click  Next . In the next window, you'll see a list of the tools to be downloaded. Click  Next . Read and accept the license agreements, then click  Finish . If you get a security warning saying that the authenticity or validity of the software can't be established, click  OK . When the installation completes, restart Eclipse. 2. Phone...