'Android/Android Development'에 해당되는 글 13건

  1. 2009.12.28 How to use WebView & WebViewClient
  2. 2009.12.12 Query to the Android Database. 1
  3. 2009.11.08 ADP1 폰 (Android Dev Phone1) How to unable SIM check Wizard
WebView  

A View that displays web pages. This class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more.

먼저 WebView를 보면 웹페이지를 나타내기 위한 뷰라고 설명하고 있습니다. 자신이 만든 액티비티에서 웹 컨텐츠를 보여주며 웹페이지 렌터링 엔진과 브라우저 기능도 포함한 WebKit을 사용한다고 되어있습니다.

이 액티비티를 사용하기 위해서는 Manifest 파일에 아래에 있는 설정파일을 넣어주어야 합니다.
<uses-permission android:name="android.permission.INTERNET" />

기본 사용법 역시 xml layer 로 구현 또는 소스로 구현이 가능합니다.
xml
<WebView android:id="@+id/webview"
  android:layout_height="wrap_content"
  android:layout_width="fill_parent" />

code 
WebView browser = (WebView)findViewById(R.id.webview);  
browser.loadUrl("http://m.daum.net/mini"); 
또는
only code
WebView webview = new WebView(this);
setContentView(webview);
webview.loadUrl("http://m.daum.net/mini");

더 자세한 내용은 레퍼런스를 참조하시기 바랍니다.

* 주의 할점 : WebView로 구현시에는 첫 화면 로딩시에는 액티비티 내로 브라우저 내용이 보이지만 그 이후 페이지 내에 링크를 통해 리로딩될시에는 내장된 브라우저가 실행 되어 버립니다. 만약 현재 액티비티 안에서만 계속 리로딩하고 싶으면 아래에 언급될 WebViewClient를 사용하도록 합니다.
 

WebViewClient

WebView의 하위클래스로서 내용, 예시, 에러, 폼등록의 렌더링 할때 호출된다. url 가로채기(intercept) 역시 이걸 통해 할수 있습니다.
WebView browser = (WebView)findViewById(R.id.webview);          browser.setWebViewClient(new WebViewClient() {

  @Override
  public boolean shouldOverrideUrlLoading(WebView view, String url)  { 
     view.loadUrl(url); 
     return true;
 }
});
browser.loadUrl("http://m.daum.net/mini/"); 

더 자세한 내용은 아래 주소를 참고하시기 바랍니다.
http://developer.android.com/reference/android/webkit/WebViewClient.html





Posted by 빈솔B
,
안드로이드 데이터 베이스에 질의 하기입니다.

Cursor android.database.sqlite.SQLiteDatabase.query(boolean distinct, String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy, String limit)

public Cursor query (boolean distinct, String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy, String limit)

Since: API Level 1

Query the given URL, returning a Cursor over the result set.

Parameters
distinct true if you want each row to be unique, false otherwise.
결과 셋이 유일한 값만 가져야 되는지 여부 결정하는 선택적 boolean 값
table The table name to compile the query against.
질의할 테이블 이름.
columns A list of which columns to return. Passing null will return all columns, which is discouraged to prevent reading data from storage that isn't going to be used.
결과 셋에 포함될 열들이 나열될 스트링 배열.
selection A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given table.
"WHERE" 구문이라 생각하면 될듯. 와일드 카드"?"가 포함될 수 있다.
selectionArgs You may include ?s in selection, which will be replaced by the values from selectionArgs, in order that they appear in the selection. The values will be bound as Strings.
"WHERE" 구문에 있었던 와일드 카드 "?"를 대체할 선택 인자 문자열 배열.
groupBy A filter declaring how to group rows, formatted as an SQL GROUP BY clause (excluding the GROUP BY itself). Passing null will cause the rows to not be grouped.
그룹바이 구문.
having A filter declare which row groups to include in the cursor, if row grouping is being used, formatted as an SQL HAVING clause (excluding the HAVING itself). Passing null will cause all row groups to be included, and is required when row grouping is not being used.
그룹바이 시 해빙구문
orderBy How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered.
순서 제어.
limit Limits the number of rows returned by the query, formatted as LIMIT clause. Passing null denotes no LIMIT clause.
리턴되는 행 갯수 제한 LIMIT 
* 제일 앞에 distinct 및 limit 는 선택적 옵션이고 나머지는 필수이다. 
Returns
  • A Cursor object, which is positioned before the first entry
See Also

Posted by 빈솔B
,
ADP1폰은 Simcard check 비활성화 방법
ADP1폰은 개발버전 플랫폼으로서 USB debbuging 이 기본적으로 활성화 되어있어서
adb shell 접근에 어려움이 없다.
윈도우xp환경에서 도스콘솔창으로 SDK tools의 adb shell 명령으로 접근한후
아래와 같이 심카드 체크 마법사 기능을 해제한 후 리부팅한다.

C:\eclipse_galileo\plugins\android-sdk-windows-1.6_r1\tools>adb shell
$ ls
ls
sqlite_stmt_journals
cache
sdcard
etc
init
logo.rle
init.trout.rc
init.goldfish.rc
init.rc
default.prop
system
data
sys
proc
sbin
root
dev
$
C:\eclipse_galileo\plugins\android-sdk-windows-1.6_r1\tools>adb shell
$ su
su
# echo app.setupwizard.disable=1 > /data/local.prop
echo app.setupwizard.disable=1 > /data/local.prop
# reboot
reboot

리부팅 후 심카드 체크 창 떠도 메뉴키를 누르면 메인화면을 볼 수 있다.
Posted by 빈솔B
,