PhoneGap的应用程序是在Android上反应迟钝 [英] PhoneGap app is unresponsive on Android

查看:113
本文介绍了PhoneGap的应用程序是在Android上反应迟钝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的PhoneGap应用程序,现在,只需要当你点击一个按钮的图片,然后显示画面的图像在同一页上。我已经建立了iOS和Android的版本,以及iOS版本工作正常。 Android版本,而另一方面,突出了按钮,但从来没有切换到摄像头的活动。可能是什么问题?

我的第一个念头是,这个问题是在我的index.html文件的JavaScript code。于是,我彻底从 PhoneGap的API相机取代了我的index.html与全示例的内容参考页。该页面显示四个按钮,每个触发器使用PhoneGap的以这种或那种方式获取图像的JavaScript函数。该应用程序构建没有错误,我的测试设备(HTC EVO 4G)上启动。再次,然而,窃听任何按钮会导致按钮突出,但没有什么事情发生。

我使用的是最近下载的PhoneGap 0.95,最新的Andr​​oid SDK(下载前两天安装),和Eclipse的ADT插件。

任何人都可以给我一些想法,如何启动调试呢?

编辑:对于它的价值,我根据在PhoneGap的步骤的入门指南为Android 。我修改根据指示存在和使用完全相同从方向文本AndroidManifest.xml文件,所以之后的第一行中的&下;支持屏... /> 块是:

 <使用许可权的android:NAME =android.permission.CAMERA/>


解决方案

迦勒>

我用的PhoneGap的Andr​​oid + HTC EVO 4G相同问题绊倒。

也许你得到这个想通了已经。为以防万一,

默认的示例应用程序运行不正常的根源是在example_android文件夹中生成index.html文件的JavaScript SRC不正确的URL。


   - 问题:我注意到的index.html在example_android文件夹链接到一个js文件不存在。
      类型=文/ JavaScript的字符集=utf-8SRC =phonegap.0.9.5.min.js
  它改成
      类型=文/ JavaScript的字符集=utf-8SRC =phonegap.0.9.5.js

在我从SRC删除ATTRIB.min,重建Android应用程序并重新部署到我的Andr​​oid手机。一切都开始正常工作。

I created a simple PhoneGap application that, right now, just takes a picture when you tap a button and then displays the picture in an image on the same page. I've built both iOS and Android versions, and the iOS version works fine. The Android version, on the other hand, highlights the button but never switches to a camera activity. What could be the problem?

My first thought was that the problem is in the Javascript code in my index.html file. So, I completely replaced the contents of my index.html with the "Full Example" from the PhoneGap API Camera reference page. This page displays four buttons, each of which triggers a Javascript function that uses PhoneGap to acquire an image in one way or another. The app builds without errors and starts up on my test device (HTC Evo 4G). Once again, however, tapping any of the buttons causes that button to highlight, but nothing else happens.

I'm using a recently downloaded PhoneGap 0.95, the latest Android SDK (downloaded and installed two days ago), and Eclipse with the ADT plugin.

Can anyone give me some ideas as to how to start debugging this?

Edit: For what it's worth, I set up my Android project according to the steps in the PhoneGap Get Started Guide for Android. I modified the AndroidManifest.xml file according to the directions there and using exactly the text from the directions, so the first line after the <supports-screens ... /> block is:

<uses-permission android:name="android.permission.CAMERA" />

解决方案

Caleb>

I was stumbled by the exact same problem with phonegap android + HTC EVO 4G.

Maybe you got this figured out already. Just in case,

The root cause of the default sample app NOT working is incorrect url for the javascript src in the index.html file generated in the example_android folder.

  -- PROBLEM: I noticed that index.html in the example_android folder  is linking to a js file don't exist. 
      type="text/javascript" charset="utf-8" src="phonegap.0.9.5.min.js"
  changed it to    
      type="text/javascript" charset="utf-8" src="phonegap.0.9.5.js"

After I removed ".min" from the src attrib, rebuild android app and redeploy to my android phone. Everything starts working fine.

这篇关于PhoneGap的应用程序是在Android上反应迟钝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆