2016年6月24日 星期五

Android-GoogleMap



在Android App中使用GoogleMap服務

要先在Android SDK Manager 中

下載最新版的Google Play Service API

接著到官方申請一個API KEY  

改到 res/values/google_maps_api.xml 對應的位置



官方指導文件  Google Maps API


GitHub 連結位置 Android-GoogleMap

Android-ListView

Android-ListView

從 json 檔案讀入資訊
資料來源 台北市政府公開資料
Hotel 定義資料內容
MyAdapter 設定資料適配器
MyListView 顯示在畫面上

GitHub 連結位置 Android-ListView

Android 一些基本 UI 實作




實做一些常用畫面元件及監聽器



日期和時間的設定對話框 DatePickerDialog &TimePickerDialog
自定義轉盤選擇器 NumberPicker

單選按鈕 RadioGroup & RadioButton

複選框 CheckBox


GitHub 連結位置 Androdi-BasicUI

2016年6月16日 星期四

慢。網誌: [教學]簽署應用程式 sign APK 發佈 Android App

慢。網誌: [教學]簽署應用程式 sign APK 發佈 Android App: [Tutorial] Sign android application apk before publishing 官方的簽署應用程式APK教學,很長,不想看吧 http://developer.android.com/tools/publishing/app-signin...

2016年6月15日 星期三

About Eclipse appcompat_v7 Error




當專案用到了新的效果 需要Class 引用 AppCompatActivity


ex.
public class MainActivity extends AppCompatActivity { ...

在Eclipse 中需要比較多的步驟來引入 appcompat_v7

這個問題也卡了很久 紀錄一下解決辦法


首先是設定 Support Library

主要是關於 Import 及 Build Path 的問題

方法參考 老灰鴨大大的筆記有很詳盡的說明

但設定完之後卻不是天下太平

接著出現各種錯誤訊息,導致專案Build不起來 (這邊整整卡了半天左右的時間...哭)

例如:

Hello World Android App, Error: workspace\appcompat_v7\res\values-v21\styles_base.xml No resource found that matches the given name

Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23

appcompat-v7:21.0.0': No resource found that matches the given name: attr 'android:actionModeShareDrawable'


eclipse android Build Tools Version 問題


Failing to launch activity due to ClassNotFoundException

Theme  引用問題

Error. You need to use a Theme.AppCompat theme (or descendant) with this activity


...各種奇怪的問題都出現了,Akira解到快昏頭


因此整理一下解決方案:

首先到Android SDK Manager 確認Build Tool下載至新版


Import android-support-v7-appcompat 專案進來


並在專案中 找到libs 裡面的 .jar檔 右鍵 Build Path > add to Build Path



再到要使用的專案中 點右鍵 > Properties > 選 Android 標籤 >

右下角 add > 找到 android-support-v7-appcompat 加進來 OK




讓Class XXXXX extends AppCompatActivity


Import 一下專案

接著到專案的 AndroidManifest.xml 找到下面



android:targetSdkVersion 設定成你要用的版本 通常是看特效支援的最低版

最後 找到 android:theme="@style/" 把它改成 @style/Theme.AppCompat.Light !!
最後 找到 android:theme="@style/" 把它改成 @style/Theme.AppCompat.Light !!
最後 找到 android:theme="@style/" 把它改成 @style/Theme.AppCompat.Light !!







然後Clean & Build 你的專案就可以用嘍

Ps. 後來在使用 Design.Weiget 又產生Error

http://stackoverflow.com/questions/31430633/how-to-add-android-design-support-library-to-eclipse-with-adt-plugin


使用此篇方法解決


2016年6月6日 星期一