2014年6月24日 星期二

Android 如何忽略發佈時 “ is not translated in ” errors?

In "Window" > "Preferences" > "Android" > "Lint Error Checking":
Find the MissingTranslation line, and set it to Warning as seen below:


2013年12月27日 星期五

2013年12月9日 星期一

JSON Editor Online

http://www.jsoneditoronline.org/

Android 大陸開發者社群

http://www.eoeandroid.com/

Objective-C Coding Style參考

Coding Guidelines for Cocoa


紐約時報行動軟體團隊的Objective-C程式碼撰寫風格手冊

多國語言付費翻譯服務

http://gengo.com/

Corona SDK 有趣的個人開發者網站

http://appsgaga.com/

作者的Corona教學blog
http://learningcoronasdk.blogspot.tw/2013/03/corona-sdk.html

Android Eclipse無法連接小米2問題

在撥號界面按*#*#717717#*#* 開啟

Adobe CS 6 官方下載連結

http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html

Objective-C 文字辨識引擎 Tesseract for iOS

https://github.com/ldiqual/tesseract-ios

安裝教學:
http://lois.di-qual.net/blog/install-and-use-tesseract-on-ios-with-tesseract-ios/

2013年11月11日 星期一

iOS推播 一行產生推播pem檔

openssl pkcs12 -in aps_development.p12 -out aps_development.pem -nodes -clcerts -password pass:''

2013年10月22日 星期二

Java json parser

https://code.google.com/p/json-simple/

example:

JSONObject jsonObj = (JSONObject) JSONValue.parse(json_string);
JSONArray jsonArray = (JSONArray) jsonObj.get("key");

2013年8月22日 星期四

Objective-C 禁用UDID 替代方案:OpenUDID


優缺點分析參考文章:http://www.alexplay.tw/2013/03/udid.html

https://github.com/ylechelle/OpenUDID

取得OpenUDID方式:
#include "OpenUDID.h"
NSString* openUDID = [OpenUDID value];

Objective-C ARC 專案中使用非ARC Code

在build Phases ->Compile Sources找到非ARC code

在Compiler Flags加上: -fno-objc-arc

2013年6月19日 星期三

Objective-C 祕技:撥完電話回到APP,讓你不會回不去。

Jie的懶教學,今天來告訴大家一個祕技:

Objective-C 呼叫電話撥號功能通常都會使用:tel
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",@"0928123123"]]];
但播完就會停留在電話程式裡...

若改成:telprompt
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"telprompt:%@",@"0928123123"]]];
結束就可以回到原本的APP畫面,

瑞凡,我可以回去了!

懶人就是要一行就搞定~完工,爆肝!

2013年6月14日 星期五

Objective-C 開啓 Google Map App 並帶入經緯度查詢

Jie的懶教學,來教大家用 Objective-C 開啓 Google Map App 並帶入經緯度查詢:

//檢查有無安裝google map
if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"comgooglemaps://"]]){        
//開啓Google Map App
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"comgooglemaps://?saddr=%f,%f&daddr=%f,%f&directionsmode=walking",起點latitude,起點longitude,終點latitude,終點longitude]]];
    }else{
//開啟網頁版Google Map(太簡單,略)
}

其他進一步設定可以參考:https://developers.google.com/maps/documentation/ios/urlscheme?hl=zh-TW 

完工,爆肝。

下載Facebook影片線上工具

http://www.downvids.net/

2013年6月10日 星期一

Blogger內文貼程式碼工具


http://formatmysourcecode.blogspot.tw/

Jie的懶教學:Android Http通訊協定資料存取 (GET,POST)

Jie的懶教學,這次來教大家來寫一隻Android的懶人HttpClient程式:

在Android使用Http通訊協定(GET,POST)讀取網頁或做資料存取的時候,
每次都要做一堆try catch處理
POST的時後設定的NameValuePair形態使用也不太習慣,
基本上POST的形態都是字串,所以接口乾脆直接改成用HashMap<String,String>來設定感覺比較親切些。

當然最重要的原因還是懶,懶人就是要想盡辦法一行就搞定:D


懶人前:
package com.example.jiehttpclient;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class JieHttpClient {

    public static String GET(String url){
        String result = "";
        HttpGet get = new HttpGet(url);
        try {
            HttpClient httpClient = new DefaultHttpClient();
            HttpResponse httpResponse = httpClient.execute(get);
            if(httpResponse.getStatusLine().getStatusCode()== HttpStatus.SC_OK){
                result = EntityUtils.toString(httpResponse.getEntity());
            }else{
                result = "JieHttpClient GET Fail";
            }
        }catch(ClientProtocolException e){
            System.out.println("JieHttpClient GET Error = "+e.getMessage().toString());
        }catch (IOException e){
            System.out.println("JieHttpClient GET Error = "+e.getMessage().toString());
        }catch (Exception e){
            System.out.println("JieHttpClient GET Error = "+e.getMessage().toString());
        }
        return result;
    }

    public static String POST(String url,HashMap<String,String> paramsMap){
        String result = "";
        HttpPost post = new HttpPost(url);

        try {

            if(paramsMap!=null){
                List<NameValuePair> params = new ArrayList<NameValuePair>();
                for(Map.Entry<String,String> entry:paramsMap.entrySet()){
                    params.add(new BasicNameValuePair(entry.getKey(),entry.getValue()));
                }
                HttpEntity httpEntity = new UrlEncodedFormEntity(params,"utf-8");
                post.setEntity(httpEntity);
            }

            HttpClient httpClient = new DefaultHttpClient();
            HttpResponse httpResponse = httpClient.execute(post);
            if(httpResponse.getStatusLine().getStatusCode()== HttpStatus.SC_OK){
                result = EntityUtils.toString(httpResponse.getEntity());
            }else{
                result = "JieHttpClient POST Fail";
            }

        }catch(ClientProtocolException e){
            System.out.println("JieHttpClient POST Error = " + e.getMessage().toString());
        }catch (IOException e){
            System.out.println("JieHttpClient POST Error = " + e.getMessage().toString());
        }catch (Exception e){
            System.out.println("JieHttpClient POST Error = " + e.getMessage().toString());
        }
        return result;
    }
}


懶人後:
        //GET
        String result = JieHttpClient.GET("GET URL");

        //POST
        HashMap<String,String> params = new HashMap<String, String>();
        params.put("key1","value1");
        params.put("key2","value2");
        String result = JieHttpClient.POST("POST URL",params);

回傳的result字串可能是HTML,XML或JSON,就視狀況去處理啦~

完工,爆肝。

2013年6月7日 星期五