반응형
반응형

Technical Reference – Intel® HTML5 App Porter Tool - BETA


Introduction

The Intel® HTML5 App Porter Tool - BETA is an application that helps mobile application developers to port native iOS* code into HTML5, by automatically translating portions of the original code into HTML5. This tool is not a complete solution to automatically port 100% of iOS* applications, but instead it speeds up the porting process by translating as much code and artifacts as possible.

It helps in the translation of the following artifacts:

  • Objective-C* (and a subset of C) source code into JavaScript
  • iOS* API types and calls into JavaScript/HTML5 objects and calls
  • Layouts of views inside Xcode* Interface Builder (XIB) files into HTML + CSS files
  • Xcode* project files into Microsoft* Visual Studio* 2012 projects

This document provides a high-level explanation about how the tool works and some details about supported features. This overview will help you determine how to process the different parts of your project and take the best advantage from the current capabilities.

How does it work?

The Intel® HTML5 App Porter Tool - BETA is essentially a source-to-source translator that can handle a number of conversions from Objective-C* into JavaScript/HTML5 including the translation of APIs calls. A number of open source projects are used as foundation for the conversion including a modified version of Clang front-end, LayerD framework and jQuery Mobile* for widgets rendering in the translated source code.

Translation of Objective-C* into JavaScript

At a high level, the transformation pipeline looks like this:

This pipeline follows the following stages:

  • Parsing of Objective-C* files into an intermediate AST (Abstract Syntax Tree).
  • Mapping of supported iOS* API calls into equivalent JavaScript calls.
  • Generation of placeholder definitions for unsupported API calls.
  • Final generation of JavaScript and HTML5 files.

About coverage of API mappings

Mapping APIs from iOS* SDK into JavaScript is a task that involves a good deal of effort. The iOS* APIs have thousands of methods and hundreds of types. Fortunately, a rather small amount of those APIs are in fact heavily used by most applications. The graph below conceptually shows how many APIs need to be mapped in order to have certain level of translation for API calls .

Currently, the Intel® HTML5 App Porter Tool - BETA supports the most used types and methods from:

  • UIKit framework
  • Foundation framework

Additionally, it supports a few classes of other frameworks such as CoreGraphics. For further information on supported APIs refer to the list of supported APIs.

반응형
반응형

Backgrid.js – A set of core Backbone UI elements

http://codevisually.com/backgrid-js/


Dated Added → Feb 16, 2013Categories → Framework

Backgrid.js is a set of components for building semantic and easily stylable data grid widgets. It offers a simple, intuitive programming interface that makes easy things easy, but hard things possible when dealing with tabular data.
The goal of Backgrid.js is to produce a set of core Backbone UI elements that offer you all the basic displaying, sorting and editing functionalities you'd expect, and to create an elegant API that makes extending Backgrid.js with extra functionalities easy.
Backgrid.js - A set of core Backbone UI elements


반응형
반응형

파이썬 3의 특징

  1. 모든 문자열은 유니코드로 처리한다.
  2. 변수명에 한글을 사용할 수도 있다.
  3. print문은 없어지고 함수 print()만 사용할 수 있다.
  4. raw_input()은 없어지고 input()을 사용한다.

 

 

 

반응형
반응형
python으로 android phone에 웹서버 만들기

 

Tutorial : http://code.google.com/p/android-scripting/wiki/Tutorials

 

 

httpd.py

import SimpleHTTPServer
from os import chdir

 

chdir('/sdcard/')

 

SimpleHTTPServer.test()

 

실행하면 아래처럼 로그가 올라온다.

그럼, 폰의 웹브라우저로 접속하면 아래와 같다.

 

 무선 AP에 접속 중이면 같은 망에 있는 다른 디바이스에서도 접근이 가능하도록 고유 IP를 찾아서 보자.

shell로 접속해서 netcfg를 실행하면  "eth0"가 실행중인 것이 지금 실행중인 Lan정보이다.

그 IP를 사용하면 된다.

 

 

 

반응형
반응형

파이썬을 이용한 단어모음파일에서  무작위로 단어 프린트하기

wordlist.txt : 단어모음 text 파일

wordlist.py : 단어장 스크립트 파일

 

Line.3 : getcwd()를 이용하여 알아낸 경로에 'sl4a'가 포함되어 있으면 경로를 지정해 주도록한다.

Line.4 : 파일을 읽는다.

Line.5 : 파일내용을 splitlines(위 이미지는 오타)로 한줄씩 분할한다.

            lambda 함수는 간단한 함수를 한줄로 줄여준다.

Line.8 : 사용자의 입력을 무한반복으로 기다린다.

 

 

 

 

 

 

반응형
반응형

예제 스크립트가 많아지면 파일및 폴더관리가 쉽지 않다.

+ADD 버튼 선택하여 Folder를 생성해서 Shell로 관리하면 된다.

물론 PC와 USB 연결해서 정리하면 훨씬 빠르겠다.

간단 명령어

pwd : 현재 위치를 보여준다.

cd scripts : scripts 폴더로 이동한다.

ls : 디렉토리내의 파일목록을 보여준다.

ls -l 또는 ll : 자세리 파일목록을 보여준다.

mv hello_android.py  scripts : scripts 폴더로 hello_android.py 파일을 이동시킨다.

rm hello_android.py: 파일 삭제

 

사진찍기, 연속 촬영하기

 

import android,time

 

a = android.Android()

 

def pic():

    return 'sdcard/sl4a/scripts/img/'\

         + time.strftime('%Y%m%d%H%M%S')\

         + '.jpg'

 

def say(it):

    a.ttsSpeak(it)

    a.makeToast(it)

 

food = 'Keeeemcheeeee!'

 

for i in range(3):

    for j in range(3,0,-1):

        say(str(j))

        time.sleep(3)

    say(food)

    a.cameraCapturePicture(pic())

 

 

 

 

 

 

 

* sleep 을 위해 time을 import 한다.

* 순차적 파일명 생성을 위해서 time.strftime을 사용한 파일명 구현

 

 

반응형

+ Recent posts