たぼさんの部屋

いちょぼとのんびり

2013-09-01から1ヶ月間の記事一覧

ListView:new ListView(context)+ArrayAdapterで作る

参考:ListViewの基本形とArrayAdapterクラス package com.efolab; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.LinearLayout; import android.wid…

特定のクラス名からmanifestファイルを参照

private void getManifest(){ ApplicationInfo appliInfo = null; String packageName ="org.mozilla.firefox"; try { Context c = createPackageContext(packageName,CONTEXT_IGNORE_SECURITY); appliInfo = c.getPackageManager().getApplicationInfo(pack…

adb(エミュレータ)

エミュレータへのコマンド adb devicesadb shell netstatadb shell $ am monitor 80

アプリのインストール確認(存在しない場合はインストール用URLへ)

アプリがインストールされていないとき main.js function launchApp(appUrl, storeUrl) { var iframe, time; iframe = document.createElement('iframe'); iframe.style.visibility = "hidden"; iframe.src = appUrl; document.body.appendChild(iframe); ti…

cookieの読み書き(javascript)

参考 Cookie とは、以下のようなことを実現するための機構です。 訪問者がそのページに何回訪れたか記録して表示する。 通常モード、フレームモードなど、訪問者の好みを記録しておき、次回訪問時にその好みのモードで表示する。 掲示板やチャットで入力した…

jsLint Unexpected '++'.

回避 var i for(i=0;i<10;i+=1){ //処理 } と、i++をi+=1

ブラウザからのuriで開いたアプリのintentで取得できるメソッドと値

Intent intent = getIntent(); としてintentを受け取った後 以下のメソッドを実行 (intent.getData())など getData().toString(): myapp://com.efolab/openwith?hoge=1&moga=100 getAction(): android.intent.action.VIEW getDataString(): myapp://com.efol…

インストール済みのパッケージを取得する

PackageManagerを使う Main.java package com.efolab.listofinstalled; import java.util.ArrayList; import java.util.List; import java.util.Map; import android.app.Activity; import android.content.Context; import android.content.pm.ApplicationI…

アンドロイド:画面をスクロールさせる

スクロールさせるとき import android.app.Activity; import android.os.Bundle; import android.widget.LinearLayout; import android.widget.ScrollView; public class ScrollViewTest extends Activity { ScrollView scrollView; LinearLayout linearLayo…

EFO+音声認識アプリについて

目的 EFOページを起動しているブラウザ(標準ブラウザ,FireFox,operaなど)から音声認識アプリを起動させる 音声認識アプリがインストールされていない場合はインストール用ページを表示する ブラウザの入力欄がフォーカス時に音声認識プログラムを起動する …

android ファイルの読み書き

private void mWriteFile() { try { FileOutputStream fileOutputStream = openFileOutput("myfile.txt", MODE_PRIVATE); String writeString = "test"; fileOutputStream.write(writeString.getBytes()); } catch (FileNotFoundException e) { Toast.makeTe…

androidブラウザを起動する

private void openBrower(){ String packageName = "com.android.browser"; String className = "com.android.browser.BrowserActivity"; Intent internetIntent = new Intent(Intent.ACTION_VIEW); internetIntent.addCategory(Intent.CATEGORY_LAUNCHER); …

android アクティビティを非表示

Manifest.xml <activity android:name="Main" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>

XMLHttpRequestの基本(GET)でtxtを読む

"use strict" ( function() { function init() { alert("start"); xhrConnect(); }; function xhrConnect() { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4) {// DONE if (xhr.status == 200) {// OK al…

HTML5基本構文

<html lang="ja"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no"> <title>html5</title> </head> <body> </body> </html>