반응형

안드로이드폰에서 파이썬을 사용하려면 SL4A(Scripting Layer for Android),

 Python for Android를 설치해야 한다.

 

SL4A 설치 : http://code.google.com/p/android-scripting/


QR로 다운 받을 수 있다. : http://android-scripting.googlecode.com/files/sl4a_r6.apk

 

SL4A를 실행하고 Menu > View > Interpreters 를 선택하면 "SHELL"이라는 메뉴가 나타난다.

shell 을 통해서 안드로이드폰과 대화를 할 수 있다.

 

난 "SHELL"이 나오지 않아서 바로 Python for Android를 설치해버렸다.

 

Python for Android 설치 : http://code.google.com/p/android-scripting/downloads/detail?name=PythonForAndroid_r4.apk

File:
Description:
Latest Python release.

Note that Python for Android is now being hosted here:
http://code.google.com/p/python-for-android/

This is a copy of the lastest release, placed here for convenience.
SHA1 Checksum: ff4dfef760880fd1cdbc164045cc859947ecbe1d What's this?

 

설치하면 Install 메뉴가 나오는데, 바로 Install 터치.

몇 번의 다운로드와 설치가 끝나고, Install > UnInstall 로 변경된다.

 

그럼, 다시 SL4A를 실행하면  Script와 Shell이 대기중일 것이다.

스크립트 목록이 나오는데, shell화면으로 가고 싶으면 View > Interpreters 로 이동한다.

 

Interpreters에서 python을 선택하면 파이썬 shell로 들어간다. 안드로이드를 import해서 핸드폰 기능을 테스트 해 볼 수 있다.

 

안드로이드 모듈을 가져온다.

>>>import android

>>>droid = android.Android()

 

>>>droid.vibrate()

: 진동을 실행한다. 그런데, 한번밖에 되지 않는다.

 

>>>droid.ttsSpeak('anneung')

: '안녕'이라고 스피커에서 나온다.

 

>>>def ann(): droid.ttsSpeak('anneung')

>>>ann()

>>>ann()

 

 

 

 

 

 

 

 

 

 

스크립트 파일을 추가해서 파일을 실행 해 볼 수 있다.

파일을 생성하고, MENU > Save & Run을 선택하면 저장하면서 실행이 된다.

반응형
반응형

Scaloid - 오픈소스 안드로이드 라이브러리

 

https://github.com/pocorall/scaloid

 

스칼라 언어로 안드로이드 개발의 어려움을 줄여주고자 만들어졌다.

 

Less painful Android development with Scala

Scaloid is a library aimed to simplify your Android code. It makes your code easy to write and understand by leveraging Scala language.

For example, the code block shown below:

val button = new Button(context)
button.setText("Greet")
button.setOnClickListener(new OnClickListener() {
  def onClick(v: View) {
    Toast.makeText(context, "Hello!", Toast.LENGTH_SHORT).show()
  }
})
layout.addView(button)

is reduced to:

SButton("Greet", toast("Hello!"))

Benefits

  • Write elegant Android software
    Scaloid provides a concise and type-safe way of writing Android application.
  • Simple to use
    Check our quick start guide
  • Compatible with your legacy code
    You can use both Scaloid and plain-old Java Android API. You can gradually improve your legacy code.
  • Maintained actively
    Scaloid is a dogfooding software. This is originally created to be used for my own Android apps.

Demos

If you want to see how Scaloid can be used in action, check a Scala port of apidemos app.

Need help using Scala language on your Android project?

There is an out-of-the-box solution. Just fork this project and start your Scala-Android app.

Features

...and many other things! Check the official Scaloid blog for news and announcements.

 

반응형
반응형

FragmentLayoutMaps

https://github.com/petedoyle/android-support-v4-googlemaps/tree/dev-samples/src/samples/FragmentLayoutMaps

 

Activity LifeCycle

 * http://developer.android.com/guide/components/activities.html

Activity LifeCycleActivity LifeCycle

 

 

 

 

Fragment LifeCycle

* http://developer.android.com/guide/components/fragments.html

 

Fragment LifeCycleFragment LifeCycle

 

 

 

######  http://developer.android.com/  #####

 

 

 

반응형
반응형

안드로이드에서 webview가 fragment 로 만들어졌을 경우 웹페이지에서 <select> 태그가 작동하지 않을때가 있다.

액티비티로 만들면 바로 작동이 되지만 일부 디바이스에서 작동이 안될때가 있어서. 속터진다. ㅋㅋ

 

인터넷 검색하면 여러 답변이 있는데, 우리가 필요로 하는 건 없었다.

 

어플에서 수정이 필요하다.

 

 

==================================================================================

 

WebView into a Fragment (android.support.v4)

 

http://stackoverflow.com/questions/9279632/webview-into-a-fragment-android-support-v4

 

==================================================================================

 

[android] 2.2에서 fragment 사용하기

 

fragment 에 대한 설명 : http://androidhuman.tistory.com/469

예제 소스는 http://daddycat.blogspot.com/2011/08/android-30-fragments-example.html 에서 가져와서 약간 수정했음.

허니컴 이하에서 사용할 때 주의할 점 : http://www.androidpub.com/1432908

 

==================================================================================

 

Select dropdown in Android webview

 

The select tag just doesn’t work sometimes in Android, especially in an app using webview. This drove me nuts for a long long time. The main fix I found, even if your select is buried deep in divs and rows and what ever, is this css:


select {
  visibility: visible;
  -webkit-appearance: menulist-text;
}


 

The -webkit-appearance might be the only one actually needed and setting it to ‘listbox’ works too.

반응형
반응형

Multi Screen & Density

안드로이드는 다양한 해상도와 density를 지원하는 여러 기기에서 동작하고 있다.

기본적으로 각각의 기기에 맞게 내부적으로 저절하지만, 이것을 최적화하는 것은 개발자의 몫이다.

안드로이드는 해상도가 다른 기기에서 별무리 없이 돌아갈 수 있도록 layout과 drawable 파일들을 옵션에  따라 분류해 해결하고 있다.

애플리케이션 구동시 안드로이드 시스템은 각 density에 알맞는 리소스를 선택하거나 이미 존재하고 있는

리소스를 불러온 후 이것을 조절해 각 디바이스마다 다른 density 문제를 해결한다.

 * http://developer.android.com/guide/topics/resources/drawable-resource.html

 

3.2 이전 버전에서는 보통 Screen size를 small, normal, large, xlarge로 구분해 layout파일을 알맞은 폴더에 배치하면, 안드로이드 시스템은 기기의 Screen에 맞게 알맞은 layout 리소스를 선택한다.

이떄 layout폴더 안에 들어가는 layout파일의 이름을 같게 하고, 배치되는 View의 id를 같게 할 경우 코드상에서는 단순히 하나의 layout파일을 보는 것과 같은 모습을 보여준다.  또한 이 폴더명에 land.port를 붙여 Screen orientation에 따른 layout도 세세하게 설정할 수 있다.

이 경우 프로그래머는 layout 파일을 수정해 여러 설정에 맞는 layout 파일을 만들고 디자이너는 drawable 리소스를 각각 만들어 여러 상황에서의 Multi Screens 환경을 구현할 수 있다.

 

 하지만 이 방법을 사용할 경우 7인치 태블릿의 경우 처리가 곤란하다. 7인치 태블릿의 large 영역에 위치하므로 5인치 정도의 기기와 동일한 영역에 위치하지만 사실상 태블릿으로서의 layout을 작성해야 한다.

 따라서 안드로이드는 추가로 3.2버전이 나오면서 좀더 세세하게 Screen size를 나눌 수 있는 방법을 제시했다.

dp를 활용해 그룹을 좀더 세밀하게 나누는 방식을로서 smallestWidth, Available screen width, Available screen height의 방법으로 설정할 수 있다.

 

 대표적인 Screen 크기에 대한 dp 분류표

 320dp

  일반적인 Screen (240 x 320 ldpi, 320 x 480 mdpi, 480 x 800 hdpi 등)

 480dp

   델의 streadk와 같은 테블릿의 중간 기기( 480 x 800 mdpi)

 600dp

   7인치 테블릿 (600 x 1024 mdpi)

 720dp

   10인치 태블릿 (720 x 1280 mdpi, 800 x 1280 mdpi 등)

 

Nine patch

애플리케이션을 개발하다 보면 UI작업이 많은 프로젝트일 경우 리소스 파일이 커서 애플리케이션이 전체적으로 무거워지는 상황이 발생할 수 있다. 또한 이미지 형태를 동적으로 변화시켜야만 할 수 있으며 이때 Nine patch는 대안이 될 수 있다.

Nine patch는 일반 png파일의 가장자리 부분에 1픽셀씩 추가해 늘어가는 영역을 지정할 수 있다. 확장자는 .9.png가 되며 일반적으로 버튼이나 에디트 텍스트창에서 많이 사용된다.

 * http://developer.android.com/tools/help/draw9patch.html 

 

The Draw 9-patch tool allows you to easily create a NinePatch graphic using a WYSIWYG editor.

For an introduction to Nine-patch graphics and how they work, please read the section about Nine-patch in the 2D Graphics document.

Here's a quick guide to create a Nine-patch graphic using the Draw 9-patch tool. You'll need the PNG image with which you'd like to create a NinePatch.

  1. From a terminal, launch the draw9patch application from your SDK /tools directory.
  2. Drag your PNG image into the Draw 9-patch window (or File > Open 9-patch... to locate the file). Your workspace will now open.

    The left pane is your drawing area, in which you can edit the lines for the stretchable patches and content area. The right pane is the preview area, where you can preview your graphic when stretched.

  3. Click within the 1-pixel perimeter to draw the lines that define the stretchable patches and (optional) content area. Right-click (or hold Shift and click, on Mac) to erase previously drawn lines.
  4. When done, select File > Save 9-patch...

    Your image will be saved with the .9.png file name.

Note: A normal PNG file (*.png) will be loaded with an empty one-pixel border added around the image, in which you can draw the stretchable patches and content area. A previously saved 9-patch file (*.9.png) will be loaded as-is, with no drawing area added, because it already exists.

Optional controls include:

  • Zoom: Adjust the zoom level of the graphic in the drawing area.
  • Patch scale: Adjust the scale of the images in the preview area.
  • Show lock: Visualize the non-drawable area of the graphic on mouse-over.
  • Show patches: Preview the stretchable patches in the drawing area (pink is a stretchable patch).
  • Show content: Highlight the content area in the preview images (purple is the area in which content is allowed).
  • Show bad patches: Adds a red border around patch areas that may produce artifacts in the graphic when stretched. Visual coherence of your stretched image will be maintained if you eliminate all bad patches.

     

     

     

     

    안드로이드 개발자 사이트

     

    http://developer.android.com/

    http://developer.android.com/guide/topics/ui/overview.html

    반응형
    반응형

    2012.04 현재 분포되어 있는 디바이스 버전별 현황

    2012.04 현재 분포되어 있는 디바이스 버전별 현황2012.04 현재 분포되어 있는 디바이스 버전별 현황. The following pie chart and table is based on the number of Android devices that have accessed Google Play within a 14-day period ending on the data collection date noted below.


    안드로이드 버전별 정리

    * 현재 시점에 아이스크림으로 업데이트한 갤럭시 S2에서 많은 문제점을 보이고 있다.


     

     코드네임

     내용

     

     Ice Cream Sandwich 4.0

     Simple, Beautiful, Useful ?

    태블릿과 스마트폰 공용OS

     

     Honeycom 3.~

     태블릿 전용

     

     Gingerbread 2.3

    인터넷접속으로 OS업데이트,

    NFC지원 등등

     

     Froyo 2.2

     
     

     Eclair 2.0/2.1

     
     

     Donut 1.6
     
       Cupcake 1.5
     
       B Android 1.1
     Android 1.0
     




    반응형
    반응형

    텍스트 입력창에서 자동고침/자동완성/자동대문자 기능 OFF

    Turn off autocorrect, autocomplete, and autocapitalize

     
    1. <input autocorrect="off" autocomplete="off" autocapitalize="off"> 


    참고 : http://davidbcalhoun.com/2010/using-mobile-specific-html-css-javascript

    반응형

    '프로그래밍 > Web' 카테고리의 다른 글

    HTML5 offilne cache  (0) 2012.04.27
    Ajax 에서 Cache가 나를 괴롭힐때~  (0) 2012.04.18
    브라우저의 User-Agent를 바로 확인하고 싶다면~  (0) 2012.03.26
    자바스크립트 차트  (0) 2012.03.05
    Comet 이란  (0) 2012.03.02
    반응형
     

    Getting started with Android PhoneGap in Eclipse

    http://wiki.phonegap.com/w/page/16494774/Getting-started-with-Android-PhoneGap-in-Eclipse

    한글 번역 : http://goodidea.tistory.com/11


    Prerequisite Software


    PhoneGap requires you have the following software installed:

         1. Eclipse Integrated Design Environment (IDE), a program to write code and manage software development

         2. Java Development Kit (JDK), the Java compiler and support tools

         3. The Android Software Development Kit (SDK), base code and emulators for developing Android apps

         4. Android Development Toolkit (ADT), a plug-in for Eclipse that makes Android development seamless

         5. Apache Ant, a program that automates software build processes (similar to 'make')

         6. Ruby, a programming language

         7. Git Bash, an alternative command program for Windows environments (Windows only)


    If you've previously done any development in the Android environment, you probably have 1-4 already installed.  If you have not, it is strongly recommended you visit http://developer.android.com/index.html to better understand Android development and create your own, "Hello, World" example prior to jumping into PhoneGap.  A great resource exists at: http://developer.android.com/sdk/installing.html for new developers.


    Step 1: Installing the Prerequisite Software


    1A. Eclipse

    Install the Eclipse IDE for Java Developers from http://www.eclipse.org/downloads/. This a ZIP archive file, extract the folder “eclipse”. Most other flavors of Eclipse (like Aptana or platform specific builds) will also work, provided that you install all the necessary Eclipse plug-ins.


    1B. Java JDK

    If you do not already have the java JDK installed on you're system, install the Java SE Development Kit - JDK 6 from here:
    http://java.sun.com/javase/downloads/index.jsp


    If you're running Windows this is a standard installer file, just follow the on screen instructions for installation.


    1C. Android SDK

    Install the Android SDK Package from here

    http://developer.android.com/sdk/index.html 


    Extract the downloaded archive and place it somewhere you'll remember and add the tools sub directory your PATH. Additional information and instructions for adding the Android SDK to your PATH can be found at:
    http://developer.android.com/sdk/installing.html


    Be sure to do the following (Windows):

    1. If you install into a folder containing a space (c:\Program Files), you must refer to it by its truncated name in the command program.  In this case "c:\progra~1".  The truncated name will be the first six characters + ~ + a sequential number starting with 1 for each instance of the same six characters.
    2. Add android SDK to your Path
    3. Add android sdk tools (\android-sdk-windows\tools) to your path. This is necessary for ruby to find the command "android create project" later on.

    1D. ADT Plug-in for Eclipse

    Install the ADT Plug-in for Eclipse as described here:

    http://developer.android.com/sdk/eclipse-adt.html


    To verify your installation of Eclipse, Android SDK, ADT, and Java, you can build a sample “Hello World” application using the instructions located here:

    http://developer.android.com/guide/tutorials/hello-world.html.


    1E. Apache ANT

    Visit: http://ant.apache.org/index.html

    • Windows -
      • If you install into a folder containing a space (c:\Program Files), you must refer to it by its truncated name in the command program.  In this case "c:\progra~1".  The truncated name will be the first six characters + ~ + a sequential number starting with 1 for each instance of the same six characters.
      • Download and unzip binaries
      • add the unzipped folder path to your PATH
    • OS X - it comes with XCode otherwise "sudo port install apache-ant".

    1F. Ruby

    Visit: http://rubyinstaller.org for an automatic installation (Windows only)

             Ruby bin 으로 이동해서  'gem install nokogiri' 를 해주면 끝

    1G. Git Bash (Windows only) 

         Visit: http://code.google.com/p/msysgit/downloads/list

         Download and install the latest full installer for official Git

         Visit: http://git-scm.com/ for additional information about Git

         Note: During installation, you may select the "Use Git Bash only" option


    Step 2: Confirm Environment Variables


    Environment variables are data stored by your system; in this case we are interested in the file locations of the various developer tools. You should have these environment variables:

    • ANDROID_HOME, location of the Android SDK (for example: D:/android-sdk-windows)
    • ANT_HOME, location of Android Ant (for example: D:\apache-ant-1.8.1)
    • JAVA_HOME, location of the JDK (for example: C:\Program Files\Java\jdk1.6.0_20)
    • Path, folders where the operating system always looks when given a command (includes these, for example: C:\Ruby191\bin; D:\apache-ant-1.8.1\bin; C:\Program Files\Java\jdk1.6.0_20\bin; D:\android-sdk-windows\tools)

    You can confirm the environment variables the following way:

    Windows:

    2A. Right-click on My Computer (or Computer)

    2B. Select Properties -> Advanced tab -> Environment Variables button).

    2C.  "Edit..." the Path to include the needed folders.  Use a semicolon (;) to separate folders.

    Hint:  You can copy the path from the address bar in Windows Explorer.




    If everything looks good in the environment variables, try opening a command prompt (Start > Run > cmd) and typing in "ant", "ruby", "java", or "android".  If you get the error message "x was not recognized as an internal or external command" you need to check your PATH value.  If the program continues to execute you can use ctrl-c to terminate it.


    Step 3. Download the PhoneGap Source Code


    First you will need to download the latest PhoneGap code.  It is hosted on github.com.  The easier way to get the code is to download it directly from the github website.

    3A.  Visit:  http://github.com/phonegap/phonegap-android



    Alternatively, you may use a dedicated 'git' client to download the code or you may use Eclipse.  This guide will not cover either of those methods.


    3B.  Unzip the files into a folder.


    Step 4. Build the Example PhoneGap App


    Now we will use Ruby and a script called 'droidgap' that is provided with PhoneGap to package up our example app.  This will create two outputs; a file called 'PhoneGap.jar' and an Android Eclipse project, which we will then import into Eclipse.


    4A.  Open a command window and change directory ('cd') to the 'phonegap-android' folder.  In Windows, use git bash as the command window.  In Mac OS, use Terminal.

    4B.  Run the following command.  This will create a PhoneGap.jar file and create a basic Android Eclipse project in the output path that can then be opened in Eclipse.


    NOTE: The droidgap script has been updated and now there are two methods to create the necessary files. The new script is significantly simpler to use than the old method. For those who prefer the old method, it is still available.


    NEW METHOD:

    4C. From the 'phonegap-android' folder, run 'ruby bin/droidgap create [path_of_application]'. For the example app, the command would be 'ruby bin/droidgap create example'. If the example folder does not exist inside 'phonegap-android', run 'ruby bin/droidgap gen' first.


    The new create command in the droidgap script will generate the Eclipse project, ready to be imported. The results of the script can be found at '[path_of_application]_android'. Example: If [path_of_application] = '~/my_app', then droidgap create will place results at '~/my_app_android'. The for the example app, the results will be placed at '../phonegap-android/example_android'


    Skip ahead to Step 5 for Eclipse import instructions.


    Run 'droidgap help' to see other new commands including run, log, test and ship.


    OLD METHOD:

    Previous users of the droidgap script please note that droidgap must now be invoked with the 'classic' command to use this method.


        ruby bin/droidgap classic "[android_sdk_path]" [name] [package_name] "[www]" "[path]"


        android_sdk_path ... The path to your Android SDK install. (Must use forward slashes (/) in path)

        name ...................... The name of your application.

        package_name ....... The name of your package (For example: com.nitobi.demo). Can not be just the app name, must contain at least one "." (i.e. "com.example").

        www ...................... The path to your www folder. (Where your HTML, CSS and JavaScript code is located)

        path ...................... The path to generate the application. (CANNOT be inside ANY Eclipse workspace) (Must use forward slashes (/) in path)

    You should get a message in your terminal saying completed!


    Example (Windows environment):


    $ ruby ./droidgap classic "C:/Progra~1/Androi~1/android-sdk-windows" pgtest com.example.android.pgtest example/ "c:/Progra~1/Androi~1/phonegap-android/output"


    In the above Windows example, the following environment settings were used:

    android_sdk_path = "c:\Program Files\Android SDK\android-sdk-windows"

    name = pgtest

    path = "c:\Program Files\Android SDK\phonegap-android\output" (This is the output location where the example files were placed)


    Example (Mac environment):


    > cd phonegap-android

    > ruby ./droidgap classic android/android-sdk-mac_86/ test_app com.mayerdan.testapp example/ ~/projects/test_droid_phonegap


    Note if you get errors like:

    BUILD FAILED

    ~/projects/phonegap-android/framework/build.xml:49: taskdef class com.android.ant.SetupTask cannot be found


    followed by more errors like:

    0:in `stat': No such file or directory - ~/projects/phonegap-android/framework/phonegap.jar


    To fix this, just run the command with the full path to the android SDK

    "sdk.dir=/andriod/android-sdk-mac_86" => "sdk.dir=/projects/andriod/android-sdk-mac_86"


    Then run `ruby ./droidgap classic /Users/danmayer/projects/android/android-sdk-mac_86 test_app com.mayerdan.testapp example/ ~/projects/test_droid_phonegap` again.


    Some notes:


    • Your output path should not be inside your Eclipse workspace. *See note in Step 5
    • Make sure the path you set to generate the application doesn't exist
    • For the www folder, phonegap-android comes with a folder called example that includes some sample html, css and js.
    • I found I was getting errors for not having set android or ant in my path. Make sure you followed the earlier steps.
    • When pointing to a directory, you need to have quotes around the path "C:/mobile/......"
    • While in the command prompt, you should manually change all the backslashes ( \ ) to forward slashes ( / ).  This helps the droidgap script with its syntax.  E.g. The android_sdk_path argument must use forward slashes (/).
    • If you install into a folder containing a space (c:\Program Files), you must refer to it by its truncated name in the command program.  In this case "c:\progra~1".  Otherwise, the script will look for "c:\Program" and fail.
      • Note: The truncated name will be the first six characters + '~' + a sequential number starting with 1 for each instance of the same six characters.  For instance if you have two folders c:\PhoneGapA and c:\PhoneGapB, the former's truncated name will become, "c:\phoneg~1" and the latter's will become, "c:\phoneg~2".
    • For Windows users:  The droidgap script is written to expect UNIX-style syntax, which is why you need to use 'git bash' to execute these commands.  'Bash' is a shell language and the 'git bash' application can handle the expected syntax.  Alternatively you may use another bash-style command application, such as 'cygwin', but if you know what that is, you know how to install and use it.
    • Do not have "tools" as a folder in your path to the android sdk folder; C:\Users\Daniel\Dev\tools\android-sdk won't work.
    • If at any point you need to check your PATH variables in git bash you can use the command "echo $PATH"

     


    Step 5. Importing Your Example App into Eclipse

    Now time to create your project. In Eclipse, go to File > New project > Android > Android Project


    Now select create project from existing source and navigate to the new folder that was generated in the last step. Select a build target and press finish.


    *NOTE: The folder you specified in the Ruby script will actually be the folder that your Eclipse will save to, and compile from and NOT your current Eclipse Workspace. Saving your folder to a location inside of a Workspace will not allow you to create the project because the .metadata folder. If you have pointed your folder to one of your Eclipse Workspaces, simply cut and paste the folder to a location that is outside of any Workspace.


     



    Now, in Eclipse you should see your project


    Rightclick phonegap.jar under the libs folder and go to Buildpath -> Add to build path.

    Note: Now the folder structure should look like the one shown below.






    Click on the project folder again and then the Run button in Eclipse, it is the button that looks like "Play". When you run this project, you should the dialog box to Run As.., choose Android Application.
    You may get the unable to launch dialog, this can happen if you have the Android 1.5 or some other file highlighted when you try to run the project. Just select the project folder and click run.


    If you have done everything correctly, there should be an Application that loads.  It should be noted that testing with an actual device is preferable to the Emulator for many reasons, namely the fact that it's easier to test the Accelerometer, Geolocation, Beep and Vibrate Functionality.  However, for testing on the actual browser browser events, and various issues with Webkit on Android the Emulator does just as well.



    Notes


    • Perhaps JAVA_HOME does not point to the JDK. Or maybe JAVA_HOME doesn't exist. To fix this you must right click on my computer, go to advanced system settings, click the advanced tab, press the environment variables button, Under system variables click new and add JAVA_HOME if it doesn't exist and make the path to the JDK that was installed earlier.
    • ERROR:

              droidgap:48:in ``': No such file or directory
             android create project -t 7 -k be.progone.test -a PG1 -n PG1 -p E:/baud/work/Mobile/Pr_Eclipse/PG1/build (Errno::ENOENT)
              from droidgap:48:in `create_android'


              SOLUTION:

              Add the Android SDK tools path to the system. Follow steps above to get to system environment variables.

              Eg: C:\Program Files\Android SDK\tools


    • ERROR:
      "BUILD FAILED
      C:\phonegap-android\framework\build.xml:49: taskdef class com.android.ant.SetupTask cannot be found"

      SOLUTION:
      Try going to the "framework" folder and check the path in the local.properties file. See if its correct and pointing to your android sdk directory.

              You MUST use a forward slash in the directory (Windows users) otherwise the paths will not match up.

              Eg: C:/Program Files (x86)/Android SDK


     

     

    • ERROR:

     

          "Click on various buttons on the example app, doesn't do anything" or some things are working but I can't tell what is going on, or I want more information how do I view the Android logs?

         SOLUTION:
         To get more information about what is going one while phonegap is running, run the Android log viewer. `adb logcat` if adb isn't found you just need to do the full path to it something like `~/projects/andriod/android-sdk-mac_86/tools/adb logcat`. If you have both a device and a Android emulator running use -d and -e like so `adb -e logcat`. This should give you more info about what is going on. Here is a small example clipping form the android logs.


     

    D/PhoneGapLog(  291): file:///android_asset/www/phonegap.js: Line 216 : TypeError: Result of expression 'accel' [undefined] is not an object.

    E/Web Console(  291): TypeError: Result of expression 'accel' [undefined] is not an object. at file:///android_asset/www/phonegap.js:216

    D/dalvikvm(  117): GC_EXPLICIT freed 1727 objects / 91840 bytes in 110ms

    D/PhoneGap(  291): The provider network is disabled

    D/SntpClient(   61): request time failed: java.net.SocketException: Address family not supported by protocol


        From this we can see that the accel is not working. And some information about the location of the Error. This helps debug problems and also helps you to give more information when asking the PhoneGap community for help. 


    반응형

    + Recent posts