달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

function createContact(){

var myContact = navigator.contacts.create({"displayName":null,"name":{"givenName":"Intellectual","formatted":"Intellectual Mollusc","middleName":null,"familyName":"Mollusc","honorificPrefix":null,"honorificSuffix":null},"nickname":null,"phoneNumbers":[{"type":"other","value":"00353 2345235","id":0,"pref":false},{"type":"mobile","value":" ","id":1,"pref":false}],"emails":[{"type":"home","value":"work@intellectualmollusc.net","id":0,"pref":false}],"addresses":[{"postalCode":"","type":"work","id":0,"locality":"cork","pref":"false","streetAddress":" ","region":" ","country":"Ireland"}],"ims":null,"organizations":[{"name":"School","title":"Student","type":null,"pref":"false","department":"Kitchen"}],"birthday":null,"note":"YourRefUniqueID:47831","categories":null,"urls":[{"type":"other","value":"intellectualmollusc.net","id":0,"pref":false}]});
myContact.save();
console.log("The contact, " + myContact.name.givenName + ", has been created");

}

'FrontEnd > PhoneGap' 카테고리의 다른 글

PhoneGap과 Cordova의 차이점은?  (0) 2013.12.30
PhoneGap으로 HelloWorld 하기..  (0) 2013.10.14
Posted by 행복한삶~!!
|

알듯 모를듯.. 자주 헛갈리는 2가지..잘 정리해두었네요..


https://developers.google.com/chrome-developer-tools/docs/remote-debugging#debugging-webviews

'FrontEnd > JavaScript' 카테고리의 다른 글

Ajax로 text 파일 읽기  (0) 2013.12.27
터치 이벤트 처리..  (0) 2013.12.24
IE에서 유용한 Javascript 디버거 Companion.JS  (0) 2013.12.23
javascript에서 array 복사  (0) 2013.12.13
window, frames, window.top 이해하기..  (0) 2013.11.20
Posted by 행복한삶~!!
|

단말에서 web app을 개발할때는 크롬 브라우저를 사용하면 디버깅이 가능했었다. 


다음 가이드 참고 http://opentutorials.org/course/580/4152


하지만 webview를 디버깅할려면 어떻게 해야 하나..궁금했는데.. .

kitkat부터..크롬브라우저 엔진이 webview에 적용되면서.. 디버깅이 가능하게 되었다.. 


얼릉..kitkat 지원되는 폰이 필요한 이유가 생겼구나.. 


https://developers.google.com/chrome-developer-tools/docs/remote-debugging#debugging-webviews




phonegap에서 제공하는 디버깅방법.. 한번 써봐야 겠구나..  


http://debug.phonegap.com

한글로 설명된 site .. 

http://elegantcoder.com/weinre


Weinre 사이트

http://people.apache.org/~pmuellr/weinre/docs/latest/

'FrontEnd > Android' 카테고리의 다른 글

Webview 및 Native간 interface  (0) 2013.12.26
Emulator 좀더 빨리 실행하는 방법..  (0) 2013.12.15
Slide menu 만들기..  (0) 2013.11.29
Posted by 행복한삶~!!
|

2개 용어의 차이를 정확히 이해를 못해서 계속 헛갈려서 좀 찾아봤다. 


좀 이해하기 쉽게 정리된 블로그 글이 있는데 한번 읽어보도록.. 

http://phonegap.com/2012/03/19/phonegap-cordova-and-what%E2%80%99s-in-a-name/


가장 핵심적인건 아래 단락인것 같다... 


PhoneGap is a distribution of Apache Cordova. You can think of Apache Cordova as the engine that powers PhoneGap, similar to how WebKit is the engine that powers Chrome or Safari. (Browser geeks, please allow me the affordance of this analogy and I’ll buy you a beer later.)


webkit := cordova

chrome,safari := phonegap 


web 사이트도 phonegap site 따로, Cordova site 따로 있다. 


둘다 같은 버젼을 배포하고 있는데, 폰갭 사이트가 관리가 좀 덜 되는 느낌이 있다. 
http://phonegap.com/install/ 에 들어가보면 최신 버젼과 2.9.0 버젼사이에 나머지 버젼들은 붕떠서 어디있는지 찾기도 어렵고.. 
최신버젼이 3.3.0 이란걸 site만 보고 알기가 쉽지 않다. 하지만 docs 에 문서들은 다 있고.. 이래저래.. 한참을 찾아봐도 이해를 못했는데... cordova site랑 비교해보고.. 관리가 부실해서 그런거구나 하고 이해를 했다.. 

cordova site에서는 지난 legacy versione들을 ftp 형태로 한꺼번에 보여주고 다운로드를 제공한다. 
phonegap site에 없는 3.0, 3.1, 3.2 까지 모두 있다. 


CLI ( Command-Line Interface ) 차이점
cli를 설치하면 정말 편리하게 프로젝트를 생성,빌드 할수 있는 장점이 있다. 
phonegap 및 cordova가 서로 cli command가 다르다..

먼저 phonegap은.. 
설치 npm install -g phonegap  
프로젝트생성  phonegap create hello com.example.hello HelloWorld
빌드
    $ cd hello
   $ phonegap build ios
   
[phonegap] detecting iOS SDK environment...
   
[phonegap] using the local environment
   
[phonegap] compiling iOS...
   
[phonegap] successfully compiled iOS app

위와 같이 phonegap이란 명령어를 사용하지만 Cordova의 경우 cordova xxxx 명령어를 사용한다.
더 자세한 명령어는 아래에서 참고 할 수 있다.


Cordova 명령어 ..

형식은 거의 99 % 같고 phonegap 대신,... cordova만 사용한다. 
$ sudo npm install -g cordova   

$ phonegap create hello com.example.hello HelloWorld

자세한 명령어는 아래에서 참고할 수 있다. 


그런데... 3.3.0 부터는 모두 cordova로 변경되었다. 더이상 phonegap을 지원하지 않는건지 일시적인건지 모르겠지만..
phonegap site에도 자세한 설명없이 3.3.0 부터는 모두 cordova 명령어를 사용한다. 




'FrontEnd > PhoneGap' 카테고리의 다른 글

contacts.create() json 형태로 생성하기..  (0) 2014.01.02
PhoneGap으로 HelloWorld 하기..  (0) 2013.10.14
Posted by 행복한삶~!!
|

ajax로 서버에 요청하기, 서버에서 파일읽어오기, 로컬의 파일읽어오기가 가능하다. 

url을 어떤걸 주느냐에 따라 responseText에 원하는 값이 넘어오는것이다. 

서버파일은 읽어오기를 안해봤지만 특정 xml이나 text 파일 경로를 그냥 주면 될듯... 

아래는 http request를  rapping해놓은 함수.. 굳이.. 이렇게 만들 필요는 없을듯 한데..

하여간 나중에 참고하기 위해 남겨둔다.. 

function loadStateDate(number) {
	var filePath = "data/stage-" + number + ".txt";
	reqHttpData(filePath, onLoadHttpData);
}

function reqHttpData(url, callback) {
	if( httpRequest == null ) {
		httpRequest = getHttpRequest();
		if( httpRequest == null )
			return;
	}
	httpRequest.open("GET", url, true);
	httpRequest.onreadystatechange = callback;
	httpRequest.send(null);
}

function getHttpRequest() {
	var httpReq = null;
	try {
		var httpReq = new XMLHttpRequest();
	} catch(err) {
		httpReq = null;
	}
	return httpReq;
}

function onLoadHttpData() {
	if( httpRequest.readyState != 4 ) {
		return;
	}

	var fileData = httpRequest.responseText;
	readStateData(fileData);
	drawCanvas();
}


Posted by 행복한삶~!!
|

원문..

http://android-er.blogspot.kr/2011/10/call-javascript-inside-webview-from.html


webview에서 Native 호출


Native에서 webview 호출 두가지 모두 가능하며 예제를 살펴보면 쉽게 구현할 수 있다. 

PieceOfLena 에서 어떻게 활용 할 수 있을지 고민해보자.. 

'FrontEnd > Android' 카테고리의 다른 글

webview 디버깅..  (0) 2014.01.02
Emulator 좀더 빨리 실행하는 방법..  (0) 2013.12.15
Slide menu 만들기..  (0) 2013.11.29
Posted by 행복한삶~!!
|

JQuery mobile을 사용하면 아래 이벤트들을 등록해서 처리할 수 있다. 

사용이 간편하고 필요한 정도는 잘 만들어진것 같은데, 더블클릭, 드래그등은 식별할수 없다. 


http://www.w3schools.com/jquerymobile/jquerymobile_ref_events.asp


그럴때 사용하는것이 hammer.js 

이름 정말 끝내준다.. you can touch this... hammer time 되시겠다.. 

http://eightmedia.github.io/hammer.js/

http://web.bogdanteodoru.com/javascript/javascript-touch-event-controller/


적당히 따라하면 좀더 세부적인 이벤트 처리까지 가능하다.. 

Posted by 행복한삶~!!
|

<link href="low_portrait.css" rel="stylesheet" type="text/css"
media="screen and (orientation: portrait) and (max-width:479px)">
<link href="low_landscape.css" rel="stylesheet" type="text/css"
media="screen and (orientation: landscape)">
<link href="high_portrait.css" rel="stylesheet" type="text/css"
media="screen and (orientation: portrait) and (min-width:480px)">

'FrontEnd > HTML5&CSS' 카테고리의 다른 글

HTML5 Video Events and API  (0) 2013.12.05
CSS 요소 숨기기..  (0) 2013.11.29
Posted by 행복한삶~!!
|


Companion 디버거... 크롬을 많이 사용하니깐 거의 사용할일이 없을것 같은데..  혹시나 해서.. 한줄 남겨 놓는다..


http://www.my-debugbar.com/ 

Posted by 행복한삶~!!
|

intel HAX 설치후에 GPU accerlator를 사용하면 android emulator가 ARM Mode Emulator 보다 좀 빨라짐..


http://software.intel.com/en-us/articles/speeding-up-the-android-emulator-on-intel-architecture

'FrontEnd > Android' 카테고리의 다른 글

webview 디버깅..  (0) 2014.01.02
Webview 및 Native간 interface  (0) 2013.12.26
Slide menu 만들기..  (0) 2013.11.29
Posted by 행복한삶~!!
|