約 4,638,593 件
https://w.atwiki.jp/gc8tom/pages/91.html
Android関連 このページは、Android関連のリンクです。 基本的にとむ専用です。 リモート操作系が多くなると思います。 リモート操作 RemoteLock 2011/3/19:とむ Android端末をWebページからロックや画面に入力したテキストを表示させることができます。 リンクはこちら ServersMan 2011/3/19:とむ Android端末の内部ファイルをWebページから操作・ダウンロードできます。 リンクはこちら
https://w.atwiki.jp/android/pages/74.html
過去のニュース 2009年3月のニュース 2009年5月のニュース 2009/04/28 Google、Android 1.5 SDKをリリース Android 1.5 is here! Android 1.5 at Google I/O Austria Getting HTC Magic In May on A1 (Mobilkom Austria) Android Developer Event Of The Year Google I/O Samsung I7500 Cleared for Launch Samsung s Android-powered I7500 caught in smudgy Russian wilds Vodafone Spain first to launch HTC Magic 2009/04/27 不思議な製品:『Android』ベースのネットブック『Alpha 680』 Android Homeアプリケーション Android 1.5に搭載される「Live Folders」とは 「simeji」ただいま栽培中 Samsung s rumored I7500 set to be its first Android outing? Android Powered Samsung I7500 Heading to Deutschland 『Android』を携帯電話以外でも利用可能に 『Android』搭載『HTC Magic』、英国で先行予約販売開始 株式会社ボトルキューブが、Android端末向けに無料ゲームアプリをリリース!不思議なキノコで箱坊をすっ飛ばせ! 初のAndroid搭載ネットブック、250ドルで今夏登場か?--米報道 2009/04/26 Skytone s Android-powered netbook to cost around $250 Keepin it real fake, part CCII meticulous G1 clone forgets the keyboard, a reason for being 2009/04/25 Android携帯「T-Mobile G1」販売台数が100万を突破、OSシェアでも4位に浮上 「Android 1.5」のソースコードが提供開始 Android所有者もアプリケーションのダウンロードが大好きらしい(但し例外もあり) Introducing GLSurfaceView Live folders Google’s Android Starting to Show Musical Potential, at Last iPhone以外のスマートフォンではアプリのダウンロードがゼロというユーザーがまだまだ多い Cupcake coming in May, says T-Mobile Germany 2009/04/24 iPhone OS 3.0 に関してひと言 エイサー、スマートフォン販売目標、年間100万台以上へ 単純に魅力がないんだと思いますよ。目新しさもないし ARM、x86に続いてハードウェアサポートに広がり AndroidがMIPSにも移植 AndroidをMIPSアーキテクチャへ移植へ,Embedded Alleyが発表 アプリの規制を強化しないと、Android 1.5で動かなくなる Google製のGit用ソースコードレビューシステム「Gerrit」 2009/5/15(金)、5/16(土)のAndroidアプリ開発セミナーの申し込みフォームを変更しました モバイル広告シェアでPalmに並んだAndroid。但しiPhoneが依然として大差でリード Apple s App Store hits a billion downloads T-Mobile sells a million G1s in the US Google Product Search For Mobile Future-Proofing Your Apps 2009/04/23 G1 Army Marching 1 Million Deep In USA Android targets automotive systems with MIPS port Debug Hacks - Android Porting的な “非ケータイ”で輝くAndroidの秘めたる可能性 Googleケータイ,世に現る 第10回 Android 1.5登場 “iPhoneとAndroidの時代”のWEBデザイン- 明日のモバイルほろ酔い語り T-Mobile 1 million Android phones sold T-Mobileの3G利用者の3分の2はG1 ソニー、いよいよ年内に「Androidケータイ」を発売か AppWidget frameworkが実装されました. Acer says it ll "likely" have one Android phone this year Acer Android Arriving In ‘09 HTC Hero Coming To Sprint In October? Routon P760 P730 Android MIDs announced Creating an Input Method 2009/04/22 クラウド時代のUIデザイン検討(デザイナー/矢野りん)CommentsAdd Star Google Analytics API公開、携帯からのアクセスも可能に 第4回:Androidの重要な機能、インテント 日本システムウエアがAndroid向けマルチメディアプレーヤーを開発,動画・音楽・画像を再生 Android OPhone To Beat Apple iPhone To China Skytone debuts ARM-based, Android-powered netbook / tablet HTC Magic Android-Phone Delayed Over “Hardware Change” Sony Ericsson が人員削減、『Android』搭載端末計画も先送り Updating Applications for On-screen Input Methods Cupcake Has Arrived 2009/04/21 「Android冷蔵庫」が地震大国ニッポンを救う? 携帯電話事業者に歩み寄るLiMoとSymbian Skytone Alpha-680 Android Netbook! Androidアプリで高速描画チューニングをするコツ Introducing home screen widgets and the AppWidget framework I-Buddie shows off its Android netbook prototype NTTドコモやKDDIはなぜ「アンドロイド」触手を伸ばすのか? グルグル回すグーグルの新CAPTCHA特許 モトローラ、Android搭載「au BOX」の開発を否定 2009/04/20 Androidタブレット GiiNii Movit、今秋発売 Android ボタンのデフォルト最少サイズ仕様変更の影響(SDK1.5) Networks In Motion、Microsoft主催のモバイルアプリ「スター誕生」で優勝 2009/04/18 クラウドOS 2009 is an Android year declares Google s Schmidt HTC Magic available for pre-order from Vodafone Google CEO Android To Have Very, Very Strong Year (GOOG) HTC Magic up for pre-order from Vodafone due out May 5th, free with monthly plan auBox Set Top Boxes NOT Based On Android GiiNii s Movit Mini Android tablet coming in October, Movit Maxx in January Sony Ericsson says no Android phone anytime soon HTC Magic Pre-Order Starts… NOW! Later This Year “Quite Significant” Android Announcements Sony Ericsson “Still Some Time To Go” 2009/04/17 簡易テキストエディタ TextEditorLite を作ってみました Symbian ports its platform to Atom, just for the heck of it 組込みLinuxセミナーの講演資料をダウンロード出来るように致しました SciPhone Dream G2+ adds WiFi to the Android KIRF madness Android Vista 64bitでスタンドアローン版のDDMSを使用する方法 2009/04/16 Android ADT0.9 変更点 (SDK1.5) 【香港エレフェア】Android採用のMIDをSkytone社が出展,OEM価格は145米ドル Chromeで右クリックで要素を検証で「id="nocookie"」→「id=""」で見れるようになります。 Samsung to launch 3 Android phones 2009/5/15(金)、5/16(土)にAndroidアプリ開発セミナーを開催します 【中国】Dell、中国スマートフォン市場進出を計画 Android 1.5 Could Distort Some Apps Company Suing Apple Shows Off Multi-touch on Android 2009/04/15 STB vs Wii さて、我々はどのスマートフォンに向けてアプリを作れば良いのか?比較してみた。 「ドコモにできないことを」 KDDI高橋氏に聞く「auらしさ」 「Google Developer Day 2009 Japan」6月9日に開催決定 第3回:Androidによる開発 Android AVDとemulator (SDK 1.5) Zune rumors heat up, MS getting ready to launch Zune software on phones? Motorola building Android-based cable boxes for Japan s KDDI? Android Set Top Box In Japan Samsung S8000 With Android! Samsung S8000 to Run Android, Play DivX, Knock Socks Off 2009/04/14 Google Developer Day 2009 Japan を開催します Android SDK 1.5 (EarleyLook)インストール手順 Getting ready for Android 1.5 Android 1.5 公式発表、early-look SDKが同日公開 Android SDK 1.5プレビュー版最速レポート 多数の新機能搭載、Android 1.5が早期リリース Android 1.5 "Early Look" SDK Now Available Adds Soft Keyboard, Video Recording, and Way, Way More Google、Android 1.5のプレビュー版をリリース Android Preference(プリファレンス) 一覧 2009/04/13 オープンソースガジェット bc9 Google Developer Day 2009 6/9に開催。申込み可能になっています(4/14) グーグルが重視する5つの分野 - 辻野社長が説明 Google開発者イベントが6月に ミクシィ笠原社長も登場 世界が注目する「アンドロイド」人気の理由とは? iアプリをiPhone向けに自動変換 ScummVM, Emulating Old School Elan Microelectronics demonstrates its eFinger multitouch tech running on Android 2009/04/12 Google App EngineのハッカソンでAndroidのバックエンドサーバーを作りました HTC Fiesta is "an Android phone," so says Bluetooth SIG 2009/04/11 NyARToolkitForAndroid On Google App Engine Android for bc9 gumstix verdex proへのAndroidポーティング手順 Google Android will win smartphone OS battle, says poll EE Timesヨーロッパのアンケート調査でAndroidの支持率30% Soulja Boy Is Android’s Newest “G”1 Netbook で携帯電話用ソフトウェアを動かす理由 Buddy Runner 2009/04/10 Android風のアイコンを作成する方法(Illustrator編) AndroidのテストツールMonkey T-Mobile to hold special event April 21st Acer Android doesn’t deliver “total internet experience” on netbooks Lenovo oPhone Video Demo T-Mobile, NYC, April 21st Big Announcement Many Developers Not Interested In Pre, Symbian Huawei Android Phone, Coming to T-Mobile Androidアプリの使いやすさを左右する5つのレイアウト LinerLayoutじゃなくてLinearLayoutじゃね? 2009/04/09 Interest in BlackBerry Rises, iPhone Levels, G1 Wanes Androidのアイコンサイズ QCon TokyoでAndroidの発表をしてきました Acer Admits to Android Prototype PC Lenovo s Android-powered OPhone gets hands-on video treatment Google と Yahoo!、『iPhone』対応の新メッセージ ツールを投入 携帯電話とPCで同一のWindowsプラットフォーム:実現可能か? armでWindows動かしてもねえ・・ Androidベースの固定電話・タブレットPC、T-Mobileから登場? Beta Test Handmark’s New Android Application! Does The T-Mobile G2 Even Exist? Android Desktop PC? Acer Testing. Acer s dream team confirms netbook Android experiments, thinks it has a "good chance" 2009/04/08 第2回:Androidのアプリケーション開発環境 グーグル、iPhoneとAndroid向け「Gmail」の新ウェブアプリ版を公開 Google,iPhone/Androidに最適化したGmailとCalendarを公開 2009/04/07 HTC delays HTC Magic launch in UK ZaurusでAndroid 1.5 Android勉強会@金沢 Android 1.5 on Zaurus Googleの「Android」を採用した小型タブレットPCなどが登場へ NBA Hits the Market 2009/04/06 Android Nine Patch(9-patch)フォーマットとは 登場間近? Android搭載ネットブックの衝撃 NYT T-Mobile to release Android-powered home phone, tablet PC next year サムスン、米国で2種類のAndroid端末を発売へ Android Hub Coming To T-Mobile Amico Brava Runs Android, Gets Pictured/Videod Zeemote JS1 wireless controller syncs up with the G1 for game time fun これは電脳メガネの操作にいいかも。 時計アプリケーションを作るための4つのサンプルソースコード OpenMoko FreeRunner development canceled, staff slashed ソフトバンクモバイルら4団体、iPhoneを使った聴覚障がい者向け情報提供システム Verizon Wireless、サポート OS の半減報道について説明 T-Mobile Summer Roadmap Details HTC Touch Pro 2, Blade Sidekick Release Dates Amico Android Handset HTC Touch Diamond2 unboxed ネットブックの価格競争がマイクロソフトを窮地に追い込む――アナリストが指摘 【Top10】Chromeに見る「軽い」と「速い」の違い Androidで物理エンジン 仮想現実感・本文 『技術評論社さんのご厚意により、本文を公開いたします。』 2009/04/05 Dlavik VMと家電をつなぐ線は家電向けMarket機能の実現手法にある、か!? ※4/6 Androidの会でしゃべる内容メモ 2009/04/04 空中に文字を書くアプリ「Air Writer」 続 Eyes-Free shell for Android actually delivers on its name 2009/04/03 ジオメディアサミットでライトニングトークをしてきました。 OpenWnnの設定画面 インテル、MoblinプロジェクトをLinux Foundationへ移管 Samsung s Android phone arriving to the party earlier than expected, bringing friends T-Mobile G3 is Huawei Android Samsung Android In June, Several More To Follow グーグル、米国外の「Android Market」でテザリングアプリ提供を復活 Android and Open Source Android Toastが固まるのを回避する方法 Androidとネットブックの相性が“抜群”な理由 空中に文字を書くアプリ「Air Writer」 Vodafone s HTC Magic reportedly delayed until May Android Market Updates Free/Paid Apps In New Markets Tethering Apps Are Back, Not With T-Mobile Google Responds To G1 Tethering 世界の携帯出荷は10%減少も,スマートフォンに望みをかける 初めてのGoogle Androidプログラミング 2009/04/02 中立性が指針のモバイルLinux「LiMo」 - Apple・Google・MS・Nokiaに対する優位性とは Google restores tethering apps to Android Market, just not in the US インテル、「Moblin.org」をLinux Foundationに譲渡 Android Creampuff release set for June 6/9にG1にCupcakeの次のCreampuffがりリースされる予定に。USBホストとテザリングがサポート予定!『Joey Sochacki「CreampuffはCupcakeよりも美味い。iPhoneに生き残るチャンスはないね。」』あちらでは4/1付けの記事ということに注目。 donutのつぎはcreampuff 不況をものともしないスマートフォン販売 BlackBerry向けのアプリストア、RIMが開設 HTC Magic Debuts May 1st 2009/04/01 組み込み開発のススメ 第1回:Androidと組み込み開発 Cupcake Orientation Animation cupcakeの画面回転アニメ グーグル、Android Marketからテザリングアプリを締め出しか Android is DOOM’d! DOOMがG1でさくさく動いてる。 【台湾】エイサー、9月に「Android」携帯発売か ウインドリバー バイスプレジデントに聞く「Androidはまだ本当の意味でOSSと言えない」 Is Google pulling tethering apps from the Android Market? Google bans tethering app from Android Market T-Mobile and Google Don’t Play Nice, Hate to be Tethered Lenovo s Android-powered OPhone shows itself again. Launch imminent? Google I/OでAndroidのセッション追加 米Google、ベンチャー投資ファンド「Google Ventures」設立 Cellmania、携帯キャリアに独自のアプリ・ストアを提供 米HPがミニノートPC用OSにAndroidを検討 - 米紙報道 HP Might Make Android Netbooks Android WiFi VoIP with Sipdroid
https://w.atwiki.jp/android/pages/43.html
チュートリアル:ノートパッドエクササイズ1 本エクササイズではシンプルなノートリストを作ります。このノートリストを使ってユーザは新規ノートを追加することができますが、ノートの編集を行うことはできません。本エクササイズでは以下の事項をデモンストレートします。 ListActivities の基本、メニューオプションの作成・操作の基本 SQLite データベース内のノートへのアクセス/保存方法 ArrayAdapter (ListView にバインドするためのもっともシンプルな方法の一つ)を用いてデータを ListView にバインドする方法 リストビューの配置の仕方やアクティビティメニューへのアイテムの追加のやり方、アクティビティがアクティビティメニューアイテムをどのように扱うか、といったスクリーンレイアウトの基本 [エクササイズ1] [エクササイズ2?] [エクササイズ3?] [追加事項?] Step 1 Notepadv1 プロジェクトを開きます。 Notepadv1 は開始点として提供されるプロジェクトです - it takes care of some of the boilerplate work that you have already seen if you followed the Hello Android tutorial (すでにHello Android(もしもしアンドロイド)のチュートリアルで見ているかもしれませんが、共通する説明があります。) 2. browse ボタンを押し、あなたが本エクササイズをコピーしたフォルダを選択し、その中からNotepadv1を選んでOKを押してください。 a. Package Explorer で右クリックし、New- Project... を選択してください。 b. Android/Android Project を選択し、Next を押してください。 c. New Android Project のダイアログで、Create project from existing source(既存のソースからプロジェクトを作成)を選択してください. d. browse ボタンを押し、あなたが本エクササイズをコピーしたフォルダを選択し、その中からNotepadv1を選んでOKを押してください。 e. Project name 欄に Notepadv1、Location 欄に選択したパスが表示されることを確認してください。 f. Finish を押します。 g. 本エクササイズのプロジェクトが Eclipse の Package Explorer に開かれ準備が完了します。 h. もし AndroidManifest.xml にエラー表示が出ていたり、Android の zipファイルに関連する問題が表示された場合は、プロジェクトの上で右クリックし、ポップアップから、Android Tools- Fix Project Properties を選択してください。(プロジェクトがライブラリの場所を正しく見ていないので、この操作でそれを修復します。) Step 2 データへのアクセスと更新について このエクササイズにおいては、単にSQLiteデータベースを直接使ってデータを保存しますが、実際のアプリケーションでは正当なContentProviderを作成し、処理をカプセル化する方がずっと良いでしょう。 もし興味があれば、content provider やデータの保存/検索/表示などに関する情報をいろいろと見つけることが出来るでしょう。 DBHelper クラスを見てみてください - このクラスは、我々が作成するノートのデータを保持するとともにその更新も可能にする、SQLiteへのデータアクセスをカプセル化するために提供されています。 典型的にはContentProviderを用いることでこのクラスを実装します。そして実際、SDKには行っている完全なNotepadアプリケーションはそのようなContentProviderを実装しています。しかし、我々がこれからするように、単にSQLiteデータベースを直接利用していけない理由はありません。このクラスについて注意すべき重要なことは、それがSQLiteデータベースのデータの保存、参照、更新の詳細の面倒をみてくれるということです。全ての行を取得するメソッド、行IDに基づいて行を取得するメソッド、新しい行を作成するメソッド、既存の行を削除するメソッド、既存の行を更新するメソッドがあります。もしあなた自身のアプリケーションでSQLiteデータベースを利用する方法に関する入門を希望なら、このクラスを見てみるか、より良くは、ContentProviderの利用例として SDK の samples/ ディレクトリに入っている完全なNotepadアプリケーションを見てみてください。 Step 3 Layout と activity とについて ほとんどのActivityはそれに関連付けられたレイアウトを持っています。レイアウトはユーザに対してそのactivityの「顔」となります。今回の例では我々のレイアウトは画面全体を覆いノートの一覧を提供します。 しかし、フルスクリーンレイアウトはActivityにとっての唯一の選択肢ではありません。フローティングレイアウト(たとえばダイアログとか警告のように)が欲しいこともあるでしょうし、レイアウトを全く必要としないこともあるでしょう(使用するレイアウトを決めない場合、activityはユーザに見えなくなります)。 Open the notepad_list.xml file in res/layout and take a look at it This is a layout definition file with a default starting point in it, we have provided this as a convenience to get you going quickly. 1. All Android layout files must start with the XML header line ?xml version="1.0" encoding="utf-8"? . 2. Also, the next definition will often (but not always) be a layout definition of some kind, in this case a LinearLayout. 3. Note also that the xml namespace of Android should always be defined in the top level component or layout in the XML so that android tags can be used through the rest of the file xmlns android="http //schemas.android.com/apk/res/android" Step 4 We need to create the layout to hold our list. Add code inside of the LinearLayout tag so the whole file looks like this (you may have to hit the Source tab in order to edit the XML file) ?xml version="1.0" encoding="utf-8"? LinearLayout xmlns android="http //schemas.android.com/apk/res/android" android layout_width="wrap_content" android layout_height="wrap_content" ListView id="@id/android list" android layout_width="wrap_content" android layout_height="wrap_content"/ TextView id="@id/android empty" android layout_width="wrap_content" android layout_height="wrap_content" android text="@string/no_notes"/ /LinearLayout 1. The ListView and TextView can be thought as two alternative views, only one of which will be displayed at once. ListView will be used when there are notes to be shown, while the TextView (which has a default value of "No Notes Yet!" defined as a string resource, will be displayed if there aren t any notes to display). 2. The @ in the id strings of the ListView and TextView means that the XML parser should parse and expand the rest of the id string and use an ID resource. 3. And, the android list and android empty are IDs that are already provided for us by the Android platform, empty is used automatically when no data is provided in the list adapter. The List Adapter knows to look for these names specifically by default. Alternatively you could also choose to change the default empty view used by the List Adapter by using the setEmptyView(). More broadly, the android.R class is a set of predefined resources provided for you by the platform, while your project s R class is the set of resources your project has defined. Resources found in the android.R resource class can be used in the XML files by using the android name space prefix (as we see here). Step 5 Resources and the R class The folders under res/ in the Eclipse project are special. There is a specific structure to the folders and files under this folder. In particular, resources defined in these folders and files will have corresponding entries in the R class allowing them to be easily accessed and used from your application. Furthermore, they will be bundled and deployed as part of the application. To make a list view, we also need to define a view for each row in the list 1. Create a new file under res/layout called notes_row.xml. 2. Add the following contents (note again the xml header is used, and the first node defines the Android xml namespace) ?xml version="1.0" encoding="utf-8"? TextView id="@+id/text1" xmlns android="http //schemas.android.com/apk/res/android" android layout_width="wrap_content" android layout_height="wrap_content"/ 3. This is the view that will be used for each notes title row — it has only one text field in it. 4. In this case we create a new id called text1. The + after the @ in the id string indicates that the id should be automatically created if it does not already exist, so we are defining text1 on the fly and then using it. 5. After saving this file, open the R.java class in the project and look at it, you should see new definitions for notes_row and text1 (our new definitions) meaning we can now gain access to these from the our code. Step 6 Next, open the Notepadv1 class in the source. We are going to alter this class to become a list adapter and display our notes, and also allow us to add new notes Notepadv1 will be a subclass of Activity called a ListActivity, which has extra functionality to accommodate the kinds of things you might want to do with a list, for example displaying an arbitrary number of list items in rows on the screen, moving through the list items, and allowing them to be selected. Take a look through the existing code in Notepadv1 class. There are some constant definitions at the top, followed by a private field we will use to create numbered note titles, and some overrides of methods from the superclass. Step 7 Change the inheritance of Notepadv1 from Activity to ListActivity public class Notepadv1 extends ListActivity Note you will have to import ListActivity into the Notepadv1 class using Eclipse, ctrl-shift-O on Windows or Linux, or cmd-shift-O on the Mac (organize imports) will do this for you. Step 8 There are already three override methods defined onCreate, onCreateOptionsMenu and onOptionsItemSelected, we need to fill these out * onCreate() is called when the activity is started — it is a little like the "main" method for the activity. We use this to set up resources and state for the activity when it is running * onCreateOptionsMenu() is used to populate the menu for the activity. This is shown when the user hits the menu button, and has a list of options they can select (like "Create Note") * onOptionsItemSelected() is the other half of the menu equation, it is used to handle events generated from the menu (e.g. when the user selects the "Create Note" item). Step 9 Fill out the body of the onCreate() method. Here we will set the title for the activity (shown at the top of the screen), use the notepad_list layout we have created for the activity display contents, set up the DBHelper instance we will use to access notes data, then populate the list with the available note titles 1. call super() with the icicle parameter passed into our method 2. setContentView to R.layout.notepad_list 3. Create a new private class field called dbHelper of class DBHelper (before the onCreate method) 4. Back in the onCreate method, construct a DBHelper instance — assign to the dbHelper field (note, you must pass this into the constructor for DBHelper) 5. Finally, call a new method -fillData()- gets the data and populates it using the helper, we haven t defined it yet 6. onCreate() should now look like this @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.notepad_list); dbHelper = new DBHelper(this); fillData(); } And remember to add the DBHelper field definition (right under the noteNumber definition) private DBHelper dbHelper; Step 10 More on menus The notepad application we are constructing only scratches the surface with menus. You can also add shortcut keys for menu items, create submenus and even add menu items to other applications!. Fill out the body of the onCreateOptionsMenu() method. We are going to add just one menu item for now, "Add Item", using a string we will create in strings.xml, and defined with a constant we will create at the top of the class to identify the Add Item operation. 1. In strings.xml resource (under res/values), add a new string for menu_insert with text "Add Item" string name="menu_insert" Add Item /string , then save the file 2. Also, you need a menu position constant at the top of the Notepadv1 class (right under the KEY_BODY definition) public static final int INSERT_ID = Menu.FIRST; 3. In the onCreateOptionsMenu() method, add the menu item. Also take care of the result of the super call being returned. The whole method should now look like this @Override public boolean onCreateOptionsMenu(Menu menu) { boolean result = super.onCreateOptionsMenu(menu); menu.add(0, INSERT_ID, R.string.menu_insert); return result; } Step 11 Fill out the body of the onOptionsItemSelected() method This is going to handle our new "Add Note" menu item. When this is selected the onOptionsItemSelected() method will be called with the item.getId() set to INSERT_ID (the constant we used to identify the menu item). We can detect this, and take the appropriate actions 1. The super.onOptionsItemSelected(item) method call goes at the end of this method — we want to catch our events first! 2. Switch statement on item.getId() 3. case INSERT_ID 4. calls new method createNote() 5. break at the end of the case 6. return the result of the superclass onOptionsItemSelected() method at the end 7. The whole onOptionsItemSelect() method should now look like this @Override public boolean onOptionsItemSelected(Item item) { switch (item.getId()) { case INSERT_ID createNote(); break; } return super.onOptionsItemSelected(item); } Step 12 Add a new createNote() method In this first version of our application, createNote() is not going to be very useful. We will simply create a new note with a title assigned to it based on a counter ("Note 1", "Note 2"...) and with an empty body. At present we have no way of editing the contents of a note, so for now we will have to be content making one with some default values 1. String noteName = "Note " + noteNumber++; (Construct the name using "Note" and the counter we have defined in the class) 2. Call dbHelper.createRow() using noteName as the title and "" for the body 3. Call fillData() method again after adding (inefficient but simple) 4. The whole createNote() method should look like this private void createNote() { String noteName = "Note " + noteNumber++; dbHelper.createRow(noteName, ""); fillData(); } Step 13 List adapters Our example uses a very simple array adapter which binds an array or list of items into a ListView. More commonly in Android, List Adapters go hand in hand with ContentProviders, and this is also a very easy way to use lists. To bind a ContentProvider to a ListView you can use a android.widget.SimpleCursorAdapter to bind data from a ContentProvider into a ListView Define the fillData() method. This is fairly long This method uses ArrayAdapter, which is the simplest way of putting data into a ListView. ArrayAdapter takes either a List or an array of Strings, and binds them into a text view provided in the layout defined for the list row (this is the text1 field in our notes_row.xml layout). The method simply obtains a list of notes from the database helper, constructs a List of Strings using the title strings from each row, and then creates an ArrayAdapter out of those items and bound to use the notes_row we defined. private void fillData() { // We need a list of strings for the list items List String items = new ArrayList String (); // Get all of the rows from the database and create the item list List Row rows = dbHelper.fetchAllRows(); for (Row row rows) { items.add(row.title); } // Now create an array adapter and set it to display using our row ArrayAdapter String notes = new ArrayAdapter String (this, R.layout.notes_row, items); setListAdapter(notes); } 1. ArrayAdapter needs a List of Strings (List String ) containing the items to display 2. The data is read out of the database as rows, and the title field from each row is used to populate the list of strings 3. We specify the notes_row view we created as the receptacle for the data 4. If you get compiler errors about classes not being found, ctrl-shift-O or (cmd-shift-O on the mac) to organize imports. Note that for this exercise we use an ArrayAdapter, this is not a very scalable solution and more typically a SimpleCursorAdapter would be used with a ContentProvider or at least a Cursor returned from a query. See the sidebar on List Adapters for more information. Step 14 Run it! 1. Right click on the Notepadv1 project 2. From the popup menu, select Run As - Android Application 3. If you see a dialog come up, select Android Launcher as the way of running the application (you can also use the link near the top of the dialog to set this as your default for the workspace, this is recommended as it will stop the plugin from asking you this every time) 4. Add new notes by hitting the menu button and selecting Add Item from the menu Solution and Next Steps You can see the solution to this class in Notepadv1Solution from the zip file to compare with your own. Once you are ready, move on to Tutorial Exercise 2 to add the ability to create, edit and delete notes. Back to the Tutorial main page...
https://w.atwiki.jp/memo_java/pages/8.html
TextViewのスクロールバー ・縦 ScrollView android layout_width ="fill_parent" android layout_height="fill_parent" TextView android id="@+id/name" android layout_width="wrap_content" android layout_height="wrap_content" android text="TextView" / /ScrollView ・横 HorizontalScrollView android layout_width="fill_parent" android layout_height="fill_parent" android id="@+id/HorizontalScrollView" TextView android id="@+id/name" android layout_width="wrap_content" android layout_height="wrap_content" android text="TextView" / /ScrollView /HorizontalScrollView
https://w.atwiki.jp/wnt0/pages/50.html
Virtual Box のインストール ubuntu-ja-10.04-desktop-i386.vhd Setting up a Linux build environment Python 2.6.5 インストール済み Make 3.81 インストール済み JDK $ sudo add-apt-repository "deb http //archive.canonical.com/ lucid partner" $ sudo apt-get update $ sudo apt-get install sun-java6-jdk パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 パッケージ sun-java6-jdk はデータベースには存在しますが、利用できません。 おそらく、そのパッケージが見つからないか、もう古くなっているか、 あるいは別のソースからのみしか利用できないという状況が考えられます E パッケージ sun-java6-jdk にはインストール候補がありません ダウンロード http //www.oracle.com/technetwork/java/javase/downloads/jdk-6u31-download-1501634.html jdk-6u31-linux-i586.bin $ chmod 755 jdk-6u31-linux-i586.bin $ ./jdk-6u31-linux-i586.bin $ sudo mv jdk1.6.0_31/ /opt $ vi .profile JAVA_HOME=/opt/jdk1.6.0_11 PATH=$PATH $JAVA_HOME/bin CLASSPATH=$JAVA_HOME/lib/tools.jar export JAVA_HOME PATH CLASSPATH Installing required packages 32-bit (experimental) $ sudo apt-get install git-core gnupg flex bison gperf build-essential \ zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \ libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \ libxml2-utils xsltproc USB 端末持ってない。 CCACHE設定 $ vi .profile export USE_CCACHE=1 ソースダウンロード後に、ccache コマンドを実行する。 http //source.android.com/source/building-kernels.html エミュレータ用カーネルソース(goldfish)の取得 $ git clone https //android.googlesource.com/kernel/goldfish.git $ cd goldfish $ git branch -r origin/HEAD - origin/master origin/android-goldfish-2.6.29 origin/master $ git checkout -b android-goldfish-2.6.29 origin/android-goldfish-2.6.29 toolchain の取得 1.8GBあった。 $ git clone https //android.googlesource.com/platform/prebuilt.git ビルド $ export PATH=$(pwd)/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin $PATH $ export ARCH=arm $ export SUBARCH=arm $ export CROSS_COMPILE=arm-eabi- $ cd goldfish $ make goldfish_defconfig $ make menuconfig (デバッグを有効にする) Kernel hacking --- Compile the kernel with debug info $ make emulator (Linux) SDKをダウンロードして解凍 SDK_ROOT/tools/android を実行(Android SDK Manager) Virtual Device を作るための Platform をダウンロード AVD Manager から Virtual Device を作成 SDK_ROOT/tools/emulator -kernel KERNEL_SRC_ROOT/arch/arm/boot/zImage @AVD_NAME (-qemu -s を付けると gdb との通信ポート(1234)を開く)
https://w.atwiki.jp/tamotech/pages/40.html
Androidアプリケーション開発 eclipse開発環境 開発に必要なプラグインをインストールする eclipseのメニュー「ヘルプ 新規ソフトウェアのインストール...」でインストールを行う。 ロケーション「https //dl-ssl.google.com/android/eclipse」でリポジトリーを追加する。名前は「Android Plugin」など、適当に。 エラーが出る場合は、「http //dl-ssl.google.com/android/eclipse」でトライしてみる価値があるらしい。 Android SDKの設定を行う eclipseのメニュー「ウィンドウ 設定...」でダイアログを開き、「Android」メニューを選択。 「SDKロケーション」にダウンロードしたandroid sdkのフォルダ(android-sdk-windows)を指定する。 Android SDK および AVD マネージャー 実機のドライバインストール とりあえず参考サイトを記録・・・ http //2dkonly.blog10.fc2.com/blog-entry-46.html
https://w.atwiki.jp/derax7/pages/18.html
Android クリックイベント Button start = (Button) findViewById(R.id.start); start.setOnClickListener(new OnClickListener() { public void onClick(View v) { //処理 } }); 状態保持 // ハイスコア読み込み SharedPreferences pref; pref = this.getSharedPreferences("PreferencesEx", Activity.MODE_PRIVATE); int stage = pref.getInt("stage", 0); // ハイスコアの書き込み pref = getContext().getSharedPreferences( "PreferencesEx", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = pref.edit(); editor.putInt("stage", level); editor.commit(); isFinishing()で終了状態取得 isFinishing()を利用すると、Activityの終了状態を判別できる 画面遷移の種類 -Intentを飛ばした場合 false -ホームボタンを押した場合 false -戻るボタンを押した場合 true Androidで音を鳴らす。[SoundPool編] SoundPoolクラスの場合、基本は下記の3処理。 ①SoundPoolを new して、 ②音声ファイル読み込んで、 ③再生する SoundPool soundPool = new SoundPool(5,AudioManager.STREAM_MUSIC, 0); // ① int soundID = soundPool.load(context, R.raw.lalala, 1); // ② soundPool.play(soundID, 1.0F, 1.0F, 1, 0, 1.0F); // ③ 【①の補足】 public SoundPool (int maxStreams, int streamType, int srcQuality) 引数: maxStreams … このSoundPoolオブジェクトで同時に扱う音声(Stream)の最大数 streamType … 音声(stream)の種類。 AudioManagerクラスに定義されている srcQuality … サンプルレートの質。(現在はまだ未使用。 0 を使えとのこと) 返り値: 成功なら、SoundPoolオブジェクト 失敗なら、null 【②の補足】 音声ファイルは、res/raw/lalala.ogg に設置したという想定。ResourceIDは R.raw.lalala になる。ここから想像できると思うが、同フォルダに lalala.wav や lalala.mp3 を設置しても区別がつかない。 ちなみに、音声ファイルを安定再生するためには oggファイルが良いとのこと。 public int load (Context context, int resId, int priority) 引数: context … コンテキスト resId … 音声ファイルのリソースID priority … 優先度サンプルレートの質。(現在はまだ未使用。将来互換性のため 1 を使え) 返り値: sound ID (再生時に使用) 【③の補足】 public final int play (int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate) 引数: soundID … load()メソッドで返される soundID leftVolume … 音量[左] (範囲:0.0~1.0) rightVolume … 音量[右] (範囲:0.0~1.0) priority … ストリーム優先度 (0 = 優先度最低) loop … ループの回数 (0 = ループ無し、-1 = 無限ループ) rate … 再生レート (1.0 = 標準の再生, 範囲:0.5~2.0) 返値 成功なら、streamID(≠0) 失敗なら、0 IntentへのExtra付加 intent.putExtra("hoge", String s); getIntent().getExtras().getString("hoge"); drawableからbitmap変換 Resources res = this.getResources(); // 画像の読み込み Bitmap bm = BitmapFactory.decodeResource(res, R.drawable.blue); Intent時のタスクについて マニフェストでアクティビティに以下のオプションを追加すると、シングルタスク(新タスクを別タスクとして記憶せず、自身に積み重ねる)モードになる。HOME画面等に設定。 android launchMode="singleTask" アイコンの作成 http //android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html Spinnerの初期値設定 spinner.setSelection(0); プログレスダイアログ progressDialog = new ProgressDialog(CoordinateActivity.this); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); progressDialog.setMessage("処理を実行中です..."); progressDialog.setCancelable(true); progressDialog.show(); (・・・処理・・・) progressDialog.dismiss(); ダイアログのカスタム OnCreateDialog(int id){・・・}内でレイアウト等の適用ができる。ダイアログ生成前に呼び出され、returnでダイアログを返してやる ボタンへのクリックリスナー追加 (Button)btn.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(GalleryActivity.this, Main.class); startActivity(intent); } }); エラー関連 以下のエラーがでた時はどうやらメモリリークっぽい。 端末再起動で直るけど、リーク箇所の特定をしたほうがよさそう Failed to install XXX.apk on device HT0B8RX02778 Too many open files 【View】子Viewの追加&削除 追加:view.addView(child); 削除;view.removeView(child); 全削除:view.removeAllViews(); カメラにIntentを飛ばして起動 // Intent for Camera Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(i, REQUEST_CODE_CAMERA); 保存先はExtraで指定 File tmpPict = new File(Environment.getExternalStorageDirectory(), "/hogehoge/" + System.currentTimeMillis() + ".jpg"); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tmpPict)); 結果をActivityResultで受け取り処理。 @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE_CAMERA) { 【View】layout.xmlの読み込み setContentView(R.layout.main); これは View v = this.getLayoutInflater().inflate(R.layout.main, null); setContentView(v) と置き換えられる(→addView()などに) 端末画面サイズ取得 WindowManager wm = (WindowManager)getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); Log.d("display", "w " + display.getWidth()); Log.d("display", "h " + display.getHeight()); ロケールの取得 Locale locale = Locale.getDefault(); Log.v("ロケールは", locale.toString()); 以下のようにロケール別に分岐できる if (locale.equals(Locale.JAPAN)) { ・・・・・ } 画面遷移 intentを飛ばして画面遷移 Intent intent = new Intent(this.context, 遷移先.class); startActivity(intent); ※manifestへのactivityの追加を忘れないこと! 【View】idから呼び出し TextView textViewData = (TextView)findViewById(R.id.hoge); textViewData.setText("hogehoge"); onClick()内でのボタン選別 @Override public void onClick(View v) { switch (v.getId()) { case R.id.button_animation Intent intent = new Intent(this, Animation.class); startActivity(intent); break; case R.id.button_sub Intent intent2 = new Intent(this, Sub.class); startActivity(intent2); break; default break; } } SharedPreference云々 SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(this); Editor ed = SP.edit(); AdMob 最近仕様が変わったらしい AdMob導入の注意点 アニメーション private Handler myHandler = new Handler() { @Override public void handleMessage(Message msg) { if (isAttached) { // 移動処理 move(); // 再描画 invalidate(); sendEmptyMessageDelayed(0, DELAY_MILLIS); } } }; http //www.adamrocker.com/blog/181/android_animation.html
https://w.atwiki.jp/floi/pages/31.html
Android は Google社が提供する携帯電話向けのプラットフォームです。 Android Developers 開発環境を作る ①Eclipse(Eclipse IDE for Java Developers)をインストール eclipse 3.4 Ganymede ②Android SDKをインストール Android SDK ③ADTをインストール
https://w.atwiki.jp/mekagazira/pages/50.html
Android SDK ダウンロード元 http //developer.android.com/intl/ja/sdk/index.html インストール先 C \Program Files\Android\android-sdk
https://w.atwiki.jp/customxperia/pages/41.html
海外モデルで提供中のAndroid 2.3.3を導入する方法について説明します。 インストール方法 標準ROM http //forum.xda-developers.com/showthread.php?t=920746 Root取得済みROMのインストール方法 準備 Android 2.1導入方法 Xrecovery インストール ここ からFTF bundle とRecovery image をDLする。 FTF bundle を解凍し、『X10i_3.0.1.G.0.75_only kernel_baseband.ftf』をFlash Tool のfirmwaresフォルダにコピーする。 Recovery image を解凍し、フォルダごと/sdcard/xrecovery/backupにコピーする. リカバリーメニューを起動し、以下を行う。 Factory Reset Wipe cache partition Partition tools format system format data format cache Advanced Option Wipe Dalvik cache Backup and restore Restore [prerooted_X10i_3.0.1.G.0.75] リブートせずに、バッテリーを外す。 Flash Toolsで『X10i_3.0.1.G.0.75_only kernel_baseband.ftf』を導入する。 Flash Tool起動 Flashクリック [X10i_3.0.1.G.0.75_only kernel_baseband.ftf]を選択し、OKクリック Xperiaにバッテリーを装着し、バックキーを押しながらUSBを差し込む 完了したらUSBを取り外し、再起動する。