Aviary SDK in Android tutorial 1 教你如何匯入Aviary SDK到你自己的Project裡面 (教學 1) (bilingual languages 雙語)

We'd use sample code in internet and Aviary Android SDK as this tutorial step  by step.(without modify any code)

教你如何匯入Aviary SDK的第一步~ 初步了解~

Intordution:

Aviary 相片編輯器 」,擁有豐富完整的修圖工具,從濾鏡邊框特效,到手動微調功能,甚至連特殊的顏色、文字、人像美化皆一應俱全

Aviary is a powerful photo editor which they created because they wanted a quick and easy way to edit our photos on the go with no fuss. 

Using their SDKs, iOS and Android app developers can add photo editing features such as cropping, sharpening, red-eye removal, filters and effects and whatnot to their applications.

 

And also it has release Aviary SDK in Android/iOS ,and in this tutorial we teach u how to start with Aviary SDK in Android

然而Aviary也有釋出SDK供大家來作使用,大宗Android、ios都有SDK,今天主要先教大家如何import Aviary的SDK來作使用

if you wnat to see more feature visit here :http://developers.aviary.com/features

What Aviary may looks like :

feature 

Our tutorial RESULT looks like this

Screenshot_2014-03-14-23-08-48    

 

Tutorial start here 

(1) Get simple project first

--"Aviary-Android-Sample-App"

先用一個簡單的範例

"Aviary-Android-Sample-App"

來試試看

Example code of the Android Aviary SDK  here on Internet  (Authors : sephiroth74)

Download Link here:

http://n22.cn/github/sephiroth74/Aviary-Android-Sample-App

 

Download this zip and extract zip into folder in your PC

so now we got a simple project to test 

If u have your own project, u can try to use yours!!

 

下載完這個zip 解壓縮完產生資料夾

當然你也可以使用你自己的專案~

 

(2) 下載官方的Aviary Android SDK

(Aviary-SDK-xxx.zip),

Download the Aviary Android SDK

Aviary-SDK-xxx.zip)from developers of aviary

 

Download Link here:

http://developers.aviary.com/download-sdk/android

Download the Aviary-Android-SDK.zip  and also extract zip into folder in your PC

ex  

 

As the figure above, now we have two folders , one is our own project , one is Aviary SDK for the use.

所以我們現在有兩個資料夾,一個是我們的project,另一個則是下載的SDK

 

(3) 打開eclipse 然後匯入兩個專案,

Open eclipse and import two projects

import  

import > import for existing Project  > next >

import2  

> browse > choose Aviary-Android-Sample-App

import3  

you may see our project contains errors but that's fine cuz

we haven't import Aviary SDK to our project here now, so that's fine if u encounter errors here.

We would not see errors after we import Aviary SDK.

你可以看到剛開出的project有許多errors,這是正常的,因為我們還沒匯入SDK,

有錯誤是正常的,等到我們匯入SDK以後,就不會有error了

pro1  

 

So Let's import the Aviary SDK project now!!

所以我們接著來匯入Aviary SDK吧!!

Step is here:

import > import for existing Project  > next >

> browse > choose "Aviary-Android-SDK"

import4  

So now we have two projects now (notice:this step has not import Aviary SDK into our own project yet)

所以我們現在有兩個專案,(注意:這步驟尚未把Aviary SDK 匯入到我們的專案內)

  

 

(4) ( * important ) (* 重要 )

Add the API KEY first  加上API KEY

we have to add our api key in the SDK and that's easy.

我們需要加上API KEY在SDK裡面內,這很簡單

1. goto http://developers.aviary.com/  register and login.

先去這網站,註冊一個帳號登入

sign in  

2. click "Add an app", choose android , key in name, finally click add

點選"Add an app",選擇Android,輸入名稱,點選ADD

add tses  

it may generate your own key and copy it

複製產生的Key

copy

3. Open Aviary-SDK/res/AndroidManifest.xml  -> paste API key 

 

打開 Aviary-SDK/res/AndroidManifest.xml  -> 貼上 API key

 

pro12

AndroidManifest.xml  

if u need more information , visit http://developers.aviary.com/docs/android/setup-guide

Add the API Key

Grab your api key from http://aviary.com/android

Inside the <application> tag add a new meta-data entry like this:

<meta-dataandroid:name="com.aviary.android.feather.v1.API_KEY"android:value="your_api_key_here"/>

Replace the tag value with your api-key.

paste  

Permissions

The Aviary-SDK requires 2 permissions: internet and write access to external storage. To grant these permissions, add these entries inside the <manifest> tag:

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

An additional permission is necessary if you want to turn on vibration feedback ( some widgets inside the Aviary-SDK use the vibration feedback for a better user experience ), but the vibration is optional. If you want to enable the vibration just add this new permission inside the <manifest> tag:

<uses-permissionandroid:name="android.permission.VIBRATE"/>

permission  

 

(5) Final Step: import Aviary SDK to our own project

最後一步:import Aviary SDK到你的專案

right click on your own project Aviary-Sample > Properties 

SDK  

Add > choose "Aviary-SDK" > OK 

SDK2    

SDK3  

you may see we don't encounter any error in our own simple project now

cuz we sucessfully import Aviary SDK into our project.

你可以看到我們原本的Project已經沒有錯誤了,

那是因為我們把Aviary成功匯入到我們的project內了

no error  

 

 Result : 成果

Screenshot_2014-03-14-23-07-35  :apps look like / APP長的像這樣

Screenshot_2014-03-14-23-08-15  : Go in our sample app project 

Screenshot_2014-03-14-23-08-48  Screenshot_2014-03-14-23-09-26  Screenshot_2014-03-14-23-10-23

 Screenshot_2014-03-14-23-10-41  Screenshot_2014-03-14-23-10-53 Screenshot_2014-03-14-23-11-19   

 

and that's what Aviary SDK begins, further Code explaination is not mention here.

 

if this tutorial really help you very much, try to give me some positive advice (anonymous can reply in this blog/forum~)

i'd be glad to hear that and try to do more tutorial in this area.^_^

thanks a lot .

如果這篇教學對你有幫助的話~請不要害羞留言唷~

我也會很開心能夠得到一些回覆,紀錄學習的經過,可能有空會在打第二篇教學~^_^

 

visit http://developers.aviary.com/docs/android/setup-guide for more detail

some Troubleshooting

from http://developers.aviary.com/docs/android/setup-guide

Problem: If your application is using a different version of the "android-support-library-v4.jar" you could see an error like this:

[2013-08-09 11:10:21 - test] Found 2 versions of android-support-v4.jar in the dependency list,
[2013-08-09 11:10:21 - test] but not all the versions are identical (check is based on SHA-1 only at this time).
[2013-08-09 11:10:21 - test] All versions of the libraries must be the same at this time.
[2013-08-09 11:10:21 - test] Versions found are:
[2013-08-09 11:10:21 - test] Path: ~/Documents/Workspaces/test/libs/android-support-v4.jar
[2013-08-09 11:10:21 - test]    Length: 556198
[2013-08-09 11:10:21 - test]    SHA-1: 4a6be13368bb64c5a0b0460632d228a1a915f58f
[2013-08-09 11:10:21 - test] Path: ~/Documents/Workspaces/Aviary-SDK/libs/android-support-v4.jar
[2013-08-09 11:10:21 - test]    Length: 484258
[2013-08-09 11:10:21 - test]    SHA-1: bd6479f5dd592790607e0504e66e0f31c2b4d308
[2013-08-09 11:10:21 - test] Jar mismatch! Fix your dependencies

Solution: Move your android-support-library-v4.jar from your app's libs folder inside the Aviary-SDK/libs folder, replacing the existing jar file.

arrow
arrow

    椿哥 發表在 痞客邦 留言(2) 人氣()