검색결과 리스트
MobileApp에 해당되는 글 17건
- 2011/10/25 iOS HostName(URL)을 기반으로 현재 디바이스의 네트워크 상태를 얻기위한 메소드
- 2011/06/11 Phonegap에서 Geolocation 관련 API를 사용할때 . .
- 2011/04/07 iScroll을 이용하여, 특정 영역만 스크롤이 가능하게 해보자.
- 2011/03/11 Phonegap을 이용하여, Webapp 개발시 . .
- 2011/02/17 dojox.mobile (2)
- 2011/02/07 jQuery Mobile alpha3이 release
- 2011/01/09 jQuery Mobile 페이지 구조
- 2010/12/29 jQuery Mobile 자주쓰는 Event와 API 몇개
- 2010/12/12 jQuery Mobile에 ListView활용하기.
- 2010/11/10 Phonegap API를 간단히 살펴보자
글
MobileApp 2011/10/25 00:58iOS HostName(URL)을 기반으로 현재 디바이스의 네트워크 상태를 얻기위한 메소드
iOS HostName을 기반으로 현재 디바이스의 네트워크 상태를 얻기위한 메소드다.
HostName은 http:// <<= 당연히 생략해야한다.
SystemConfiguration.h 을 import하고..
- (BOOL)networkReachable {
Reachability *r = [Reachability reachabilityWithHostName:@"121.137.211.103"];
NetworkStatus internetStatus = [r currentReachabilityStatus];
if(internetStatus == NotReachable) {
return NO;
}
return YES;
}
wifi 또는 wwan의 구분 또한 가능하다.
NetworkStatus enum은 아래와 같다.
typedef enum {
NotReachable = 0,
ReachableViaWWAN, // this value has been swapped with ReachableViaWiFi for PhoneGap backwards compat. reasons
ReachableViaWiFi // this value has been swapped with ReachableViaWWAN for PhoneGap backwards compat. reasons
} NetworkStatus;
따라서
internetStatus != ReachableViaWWAN
internetStatus != ReachableViaWiFi
처럼 현재 디바이스의 네트워크 상태를 보다 상세히 파알할 수도 있다.
'MobileApp' 카테고리의 다른 글
| iOS HostName(URL)을 기반으로 현재 디바이스의 네트워크 상태를 얻기위한 메소드 (0) | 2011/10/25 |
|---|---|
| Phonegap에서 Geolocation 관련 API를 사용할때 . . (0) | 2011/06/11 |
| iScroll을 이용하여, 특정 영역만 스크롤이 가능하게 해보자. (0) | 2011/04/07 |
| Phonegap을 이용하여, Webapp 개발시 . . (0) | 2011/03/11 |
| dojox.mobile (2) | 2011/02/17 |
| jQuery Mobile alpha3이 release (0) | 2011/02/07 |
트랙백
댓글
글
MobileApp 2011/06/11 23:55Phonegap에서 Geolocation 관련 API를 사용할때 . .
최근에 phonegap0.9.5.1로 프레임웍을 업데이트 하였더니...
iOS에서는 Geolocation 인터페이스를 이용하여 현재 location 정보를 얻어오는
아래코드가 아무 이상없이 잘 동작하였으나, 안드로이드에서는 갑작스레 동작이 원활이 되지
않았음. 혹시나 API 변경 사항이 있나 문서를 살펴 보았는데도 변동 사항이 없었다.
var self = this;
navigator.geolocation.getCurrentPosition( function(position) {
self._lat = position.coords.latitude;
self._lng = position.coords.longitude;
self.getPositionSuccess(type, destinationAddress);
});직접 안드로이드 phonegap.0.9.5.1.js를 살펴 보니 아래와 같은 코드가 추가 되어 있었다.
동일한 코드로 다양한 플랫폼을 지원한다는 phonegap의 컨셉이 흐릿해진 순간이었다 . .
/**
* Force the PhoneGap geolocation to be used instead of built-in.
*/
Geolocation.usingPhoneGap = false;
Geolocation.usePhoneGap = function() {
if (Geolocation.usingPhoneGap) {
return;
}
Geolocation.usingPhoneGap = true;
// Set built-in geolocation methods to our own implementations
// (Cannot replace entire geolocation, but can replace individual methods)
navigator.geolocation.setLocation = navigator._geo.setLocation;
navigator.geolocation.getCurrentPosition = navigator._geo.getCurrentPosition;
navigator.geolocation.watchPosition = navigator._geo.watchPosition;
navigator.geolocation.clearWatch = navigator._geo.clearWatch;
navigator.geolocation.start = navigator._geo.start;
navigator.geolocation.stop = navigator._geo.stop;
};위 메소드는 iOS를 위한 phonegap.0.9.5.1.js 에는 존재하지 않는다.
때문에 iOS에서 usePhoneGap() 메소드를 수행하면, 오류가 당연히 발생한다.
결국 아래와 같이 플랫폼별 분기를 시켜줘야 한다
if(jquery.csob.isAndroid == false){
//Android일때는 ChildBrowser 메소드를 수행할 필요가 없다.
ChildBrowser.install();
}else{
/*
Android일때 Geolocation 기능을 사횽하고자 할때 아래 메소드를 수행해줘야 한다.
*/
Geolocation.usePhoneGap();
}
'MobileApp' 카테고리의 다른 글
| iOS HostName(URL)을 기반으로 현재 디바이스의 네트워크 상태를 얻기위한 메소드 (0) | 2011/10/25 |
|---|---|
| Phonegap에서 Geolocation 관련 API를 사용할때 . . (0) | 2011/06/11 |
| iScroll을 이용하여, 특정 영역만 스크롤이 가능하게 해보자. (0) | 2011/04/07 |
| Phonegap을 이용하여, Webapp 개발시 . . (0) | 2011/03/11 |
| dojox.mobile (2) | 2011/02/17 |
| jQuery Mobile alpha3이 release (0) | 2011/02/07 |
트랙백
댓글
글
MobileApp 2011/04/07 20:39iScroll을 이용하여, 특정 영역만 스크롤이 가능하게 해보자.
참고 : http://cubiq.org/iscroll
예를 들어 아래와 같은 jquery mobile을 이용하여, 만든 webapp을 구현했다고 치자.
.
.
<div data-role="page" id="page_default" data-theme="e">
.
.
<div data-role="content">
<div id="collapser" data-role="collapsible" data-collapsed="true">
<h3>검색어 입력</h3>
<input id="enteredItemField" type="search" value="" placeholder="검색어를 입력하세요."</input>
<div data-role="controlgroup" data-type="horizontal" align="center">
<a id="enteredItemSaveButton"href="#" data-icon="star" data-role="button">검색어 저장</a>
<a id="directSearchButton"href="#" data-icon="search" data-role="button">바로 검색</a>
</div>
</div>
<ul id="ItemList" data-role="listview">
<!-- 여기에 동적으로 li가 붙는다. -->
</ul>
</div>
<!-- CONTENT END -->
</div>
.
.
1. 특정 영역만을 scroll가능도록 하기 위해서 일단 이 페이지 (#page_default) 의 스크롤링을 prevent하자.
2. iscroll.js를 페이지에 import하자.
3. scrolling되었으면 하는 영역을 래핑하자.
<div id="wrapper">
<div id="scroller">
<ul id="itemList" data-role="listview">
<li>...</li>
</ul>
</div>
</div>
4. wrapper를 위한 css를 내 어플에 맞게 customize하자.
#wrapper {
position:relative;
z-index:1;
width:100%;
height:350px;
overflow:auto;
}
5. iscroll 객체를 listview dom id와 함께 인스턴싱하자.
myScvar roll = new iScroll('scroller');
결과 >> 리스트 부분만 스크롤링 된다.
이 모든 내용은
http://cubiq.org/iscroll 에 돔 더 자세히 잘 나와 있으니, 참고도록 하자.
'MobileApp' 카테고리의 다른 글
| iOS HostName(URL)을 기반으로 현재 디바이스의 네트워크 상태를 얻기위한 메소드 (0) | 2011/10/25 |
|---|---|
| Phonegap에서 Geolocation 관련 API를 사용할때 . . (0) | 2011/06/11 |
| iScroll을 이용하여, 특정 영역만 스크롤이 가능하게 해보자. (0) | 2011/04/07 |
| Phonegap을 이용하여, Webapp 개발시 . . (0) | 2011/03/11 |
| dojox.mobile (2) | 2011/02/17 |
| jQuery Mobile alpha3이 release (0) | 2011/02/07 |
트랙백
댓글
글
MobileApp 2011/03/11 11:38Phonegap을 이용하여, Webapp 개발시 . .
Phonegap을 이용하여, Webapp 개발시 . .
deviceready 이벤트가 발생하지 않아, 헤매는 이들을 몇몇 보았다.
이는
" This is an event that fires when PhoneGap is fully loaded. "
(ref : http://docs.phonegap.com/phonegap_events_events.md.html
말 그대로 deviceready 이벤트는 phonegap 이 모두 로드 완료되었을대 fire되는 이벤트 . .
결국 phonegap 로드가 실패했으니 deviceready 이벤트가 발생하지 않은것.
대부분 phonegap.js의 경로가 잘못되어 발생하는 문제다.
phonegap.js의 import 구문의 경로와 실제 phonegap.js의 위치가 일치하는지를 다시 한번 살펴보도록 하자.
'MobileApp' 카테고리의 다른 글
| Phonegap에서 Geolocation 관련 API를 사용할때 . . (0) | 2011/06/11 |
|---|---|
| iScroll을 이용하여, 특정 영역만 스크롤이 가능하게 해보자. (0) | 2011/04/07 |
| Phonegap을 이용하여, Webapp 개발시 . . (0) | 2011/03/11 |
| dojox.mobile (2) | 2011/02/17 |
| jQuery Mobile alpha3이 release (0) | 2011/02/07 |
| jQuery Mobile 페이지 구조 (0) | 2011/01/09 |
트랙백
댓글
글
MobileApp 2011/02/17 15:31dojox.mobile
dojox.mobile
dojox에 mobile 패키지가 있는줄 오늘에서야 알았다.
호기심반 기대반으로 오늘부터 조금씩 살펴보아야 겠다.
http://dojotoolkit.org/reference-guide/dojox/mobile.html
http://dojofoundation.org/mobile/
일단 dojo 1.5에서 출발의 의미를 가지고 있고, 1.6에서 부터나 쓸만해 질것 같다.
'MobileApp' 카테고리의 다른 글
| iScroll을 이용하여, 특정 영역만 스크롤이 가능하게 해보자. (0) | 2011/04/07 |
|---|---|
| Phonegap을 이용하여, Webapp 개발시 . . (0) | 2011/03/11 |
| dojox.mobile (2) | 2011/02/17 |
| jQuery Mobile alpha3이 release (0) | 2011/02/07 |
| jQuery Mobile 페이지 구조 (0) | 2011/01/09 |
| jQuery Mobile 자주쓰는 Event와 API 몇개 (0) | 2010/12/29 |
태그
dojo mobile트랙백
댓글
글
MobileApp 2011/02/07 15:08jQuery Mobile alpha3이 release
Toolbars
Fixed positioning of headers and footers was completely re-factored and is much smoother so they no longer scroll with the page. Persistent footer nav bars now reliably show across pages.
Download
We provide CDN-hosted versions of jQuery Mobile for you to include into your site. These are already minified and compressed – and host the image files as well. It’ll likely be the fastest way to include jQuery Mobile in your site.
CDN-Hosted JavaScript:
- Uncompressed: jquery-mobile-1.0a3.js (130KB, useful for debugging)
- Minified and Gzipped: jquery-mobile-1.0a3.min.js (17KB, ready to deploy)
CDN-Hosted CSS:
- Uncompressed: jquery-mobile-1.0a3.css (53KB, useful for debugging)
- Minified and Gzipped: jquery-mobile-1.0a3.min.css (7KB, ready to deploy)
Copy-and-Paste Snippet:
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" /> <script src="http://code.jquery.com/jquery-1.5.min.js"></script> <script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
More details on how this works can be found in the page and layout documentation.
If you want to host the files yourself you can download a zip of all the files:
ZIP File:
- Zip File: jquery-mobile-1.0a3.zip (JavaScript, CSS, and images)
'MobileApp' 카테고리의 다른 글
| Phonegap을 이용하여, Webapp 개발시 . . (0) | 2011/03/11 |
|---|---|
| dojox.mobile (2) | 2011/02/17 |
| jQuery Mobile alpha3이 release (0) | 2011/02/07 |
| jQuery Mobile 페이지 구조 (0) | 2011/01/09 |
| jQuery Mobile 자주쓰는 Event와 API 몇개 (0) | 2010/12/29 |
| jQuery Mobile에 ListView활용하기. (0) | 2010/12/12 |
트랙백
댓글
글
MobileApp 2011/01/09 21:01jQuery Mobile 페이지 구조
jQuery Mobile의 페이지 기본 구조는 아래와 같이
Page Container 하위 Header, Content, Footer를 기본으로 이루어져있다.
(Header, Footer가 빠진다고 해서 문제 될 것은 없다.)
- Single 페이지Page > Header, Content, Footer
<div data-role="page"> <div data-role="header">...</div> <div data-role="content">...</div> <div data-role="footer">...</div> </div>
- Multi 페이지<body> Page> Header, Content, FooterSubPage> Header, Content, Footer페이지간 이동은 anchor태그에 이동할 페이지의 id를 href="#bar" 와 같은 방식으로 설정한다.(스크립트를 이용하여, 페이지 이동을 하고자 할때는$.mobile.changePage("#bar", "pop", false, false); 처럼 changePage 메소드를 이용하면 된다.참고 : http://jquerymobile.com/demos/1.0a2/#docs/api/methods.html)<!-- 메인 페이지 --> <div data-role="page" id="foo"> <div data-role="header"> <h1>Foo</h1> </div><!-- /header --> <div data-role="content"> <p>메인 페이지 입니다</p> <p>다음 페이지 : <a href="#bar">Click</a></p> </div><!-- /content --> <div data-role="footer"> <h4>Page Footer</h4> </div><!-- /header --> </div><!-- /page --> <!-- 서브 페이지 --> <div data-role="page" id="bar"> <div data-role="header"> <h1>Bar</h1> </div><!-- /header --> <div data-role="content"> <p>서브 페이지 입니다</p> <p><a href="#foo">돌아가기</a></p> </div><!-- /content --> <div data-role="footer"> <h4>Page Footer</h4> </div><!-- /header --> </div><!-- /page --> </body>
'MobileApp' 카테고리의 다른 글
| dojox.mobile (2) | 2011/02/17 |
|---|---|
| jQuery Mobile alpha3이 release (0) | 2011/02/07 |
| jQuery Mobile 페이지 구조 (0) | 2011/01/09 |
| jQuery Mobile 자주쓰는 Event와 API 몇개 (0) | 2010/12/29 |
| jQuery Mobile에 ListView활용하기. (0) | 2010/12/12 |
| Phonegap API를 간단히 살펴보자 (0) | 2010/11/10 |
트랙백
댓글
글
MobileApp 2010/12/29 11:56jQuery Mobile 자주쓰는 Event와 API 몇개
Page show/hide events
pagebeforeshowpageshowpagehide
이벤트명 그대로 Page 노출 시점에 따라 발생하는 이벤트다.
예> pagesshow되자 마자 alert을 발생해보자.$('div#page_main').live('pageshow',function(event, ui){
alert('page_main 페이지가 보입니다.');
});
Page initialization events
pagecreate
pagebeforecreate
페이지 이동
간단 활용 예>
/* div#page_main으로 slideup하며 이동 */$.mobile.changePage("div#page_main", "slideup");
페이지 로딩 메시지 노출
$.mobile.pageLoading(method)
$.mobile.pageLoading( true ); // 페이지 로더를 숨긴다.$.mobile.pageLoading( false ); // 페이지 로더를 보여준다.
'MobileApp' 카테고리의 다른 글
| jQuery Mobile alpha3이 release (0) | 2011/02/07 |
|---|---|
| jQuery Mobile 페이지 구조 (0) | 2011/01/09 |
| jQuery Mobile 자주쓰는 Event와 API 몇개 (0) | 2010/12/29 |
| jQuery Mobile에 ListView활용하기. (0) | 2010/12/12 |
| Phonegap API를 간단히 살펴보자 (0) | 2010/11/10 |
| PhoneGap + jQueryMobile을 이용한 WebApp개발 -Footer Navbar (0) | 2010/11/10 |
트랙백
댓글
글
MobileApp 2010/12/12 04:08jQuery Mobile에 ListView활용하기.
jQuery Mobile은 다양한 형태의 ListView들을 지원한다.
Static한 ListView를 정의할때 단순히 아래와 같이 구성하면된다.
<ul data-role="listview" data-theme="d" data-inset="true">
<li>Acura</li>
<li>Audi</li>
<li>BMW</li>
<li>Cadillac</li>
<li>Chrysler</li>
<li>Dodge</li>
<li>Ferrari</li>
</ul>
동적으로 리스트를 추가하거나,삭제해 보자.
위의 예를 기반으로 리스트 내용을 모두 지우고 새로운 리스트를 추가해 보자.
jQuery("ul li").remove(); //ul하위 모든 ui를 삭제한다.
var ulNode = jQuery("ul"); //ul 노드를 가져온다.
ulNode.append("<li>새로운 리스트</li>"); //ul노드에 샤로은 li노드를 추가한다.
ulNode.listview("refresh"); //refresh 메소드를 실행한다.
jQuery Mobile 내부를 살펴보니, jQuery ui 의 영향을 받아,
jQuery.widget 팩토리를 이용하여 컴포넌트들이 개발되어져 있었다.
예를 들면 아래 navbar같은 녀석(간단한 녀석으로 뽑아보았다 +_+)
더보기
jQuery Mobile API가 좀 부실하니 . . .
요런 번거로움이 . . . .
(* 참고로 jQuery Mobile내부 인터페이에 "_ 언더바"로 시작하는 메소드들은 private 메소드로서 접근이
불가능하다. 이 부분은 $.widget.bridge의 구조를 살펴보세용.
참고 : http://www.erichynds.com/jquery/using-jquery-ui-widget-factory-bridge/)
'MobileApp' 카테고리의 다른 글
| jQuery Mobile 페이지 구조 (0) | 2011/01/09 |
|---|---|
| jQuery Mobile 자주쓰는 Event와 API 몇개 (0) | 2010/12/29 |
| jQuery Mobile에 ListView활용하기. (0) | 2010/12/12 |
| Phonegap API를 간단히 살펴보자 (0) | 2010/11/10 |
| PhoneGap + jQueryMobile을 이용한 WebApp개발 -Footer Navbar (0) | 2010/11/10 |
| PhoneGap + jQueryMobile을 이용한 WebApp개발 -툴바 (0) | 2010/11/09 |
트랙백
댓글
글
MobileApp 2010/11/10 03:24Phonegap API를 간단히 살펴보자
camera object provides access to the device's default camera application.contacts object provides access to the device contacts database. 'MobileApp' 카테고리의 다른 글
| jQuery Mobile 자주쓰는 Event와 API 몇개 (0) | 2010/12/29 |
|---|---|
| jQuery Mobile에 ListView활용하기. (0) | 2010/12/12 |
| Phonegap API를 간단히 살펴보자 (0) | 2010/11/10 |
| PhoneGap + jQueryMobile을 이용한 WebApp개발 -Footer Navbar (0) | 2010/11/10 |
| PhoneGap + jQueryMobile을 이용한 WebApp개발 -툴바 (0) | 2010/11/09 |
| PhoneGap + jQueryMobile을 이용한 WebApp개발 -멀티 페이지 전환하기 (0) | 2010/11/08 |
RECENT COMMENT