android,html5,phonegapRelated issues-Collection of common programming errors


  • Squonk
    android
    This is my code,what’s the matter?Operation result is”has stopped unexpectedly”. It can go through when remove the OnClickListener,that is say,that button to click on the binding is wrong?Please help me,thank you!gao.javapackage cn.gao; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.*; public class gao<hellotwo> extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceS

  • abishekshenoy
    java android
    Below is the error that logcat springs up. It is unable to parse the <!DOCTYPE…> at the start of any xml document. I tried my program with a page that doesn’t have the DOCTYPE tag and it worked successfully. I have used setFeature to enable ‘FEATURE_PROCESS_DOCDECL’, but it doesn’t solve the problem.The Error: org.xmlpull.v1.XmlPullParserException: Unexpected <! (position:START_DOCUMENT null@1:1 in java.io.InputStreamReader@424355f0)Excerpt of my code:URL url = new URL(“http://www.googl

  • bobygerm
    android google-plus
    My android app is using the Google+ API to connect the user to this social network and to record activities in it.My code is straightforward, I copied the sample code to write a review activity as a moment here : https://developers.google.com/+/mobile/android/app-activitiesmonPlusClient = new PlusClient.Builder(this, new GooglePlayServicesClient.ConnectionCallbacks() {@Overridepublic void onDisconnected() {Log.d(TAG_DEBUG, “monPlusClient, onDisconnected”);}@Overridepublic void onConnected(Bundle

  • IDV
    android shell
    I wrote this script for copying XML files I received to a spot on my sdcard. However when I run it in terminal i get the following. Can someone explain if i did something wrong or whats going on?cd /data/com.idv.android/cache/receivedxml/ /data/xml.sh[4]: cd: /data/com.idv.android/: No such file or directory /data/xml.sh[7]: syntax error: ‘cat’ unexpectedAdditional info: Samsung Galaxy S2 Skyrocket / Rooted /#!/system/bin/sh set -x verbosecd /data/data/com.idv.android/cache/receivedxml/ if ls *.

  • Argus9
    android spinner
    My app has a spinner with four entries in it. I need to be able to retrieve which of these labels is selected, not the actual labels themselves. Below is my partial code for doing this:// Set up the activity’s SpinnerspinnerAdapter = ArrayAdapter.createFromResource(this, R.array.pay_periods, android.R.layout.simple_spinner_item);spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);Spinner s = (Spinner) findViewById(R.id.main_spinner_payperiod);s.setAdapter(spinne

  • Harshit Syal
    android android-service
    I am experiencing some unexpected service leaked error when I change activity to landscape mode. The app is running fine, the error only shows up in logcat.logcat error is :E/ActivityThread(16640): Activity com.amazon.hsyal.ui.VoltageSODLoggerActivity has leaked ServiceConnection com.amazon.hsyal.ui.VoltageSODLoggerActivity$1@41461908 that was originally bound hereE/ActivityThread(16640): android.app.ServiceConnectionLeaked: Activity com.amazon.hsyal.ui.VoltageSODLoggerActivity has leaked Servic

  • Sandip Armal Patil
    android parameters camera rotation image
    Without calling parameters.setRotation(), the direction of the picture saved by pictureCallback is not same as preview on screen, so I add the line parameters.setRotation(90) for test, after adding this line, the direction of the saved picture is correct, and without any problem in my Nexus One.In Galaxy Nexus, the direction is also correct, but everything in the picture is thin and tall than what they are, and I notice that the result is inconsistency, sometimes thinner and taller than other ti

  • namehere
    java android minimax appcrash
    I have this android app that plays Go, a board game. The app is based on negamaxwith alpha beta pruning.The app works fine for a negamax search depth of 1(search depth is the third parameter passed to rootnegamax() in generate(), both in the aiplayer class). However, when search depth is raised, whenever the game is the computer’s turn to move, the app says ‘Unfortunately, Go has stopped’ and crashes. I figured out commenting out the line responsible for alpha beta pruning in negamax() somehow f

  • Marcin Orlowski
    android intellij-idea android-studio
    When I add this line of code in my ActivityfindViewById(R.id.btFilter).setOnLongClickListener(new View.OnLongClickListener() {@Overridepublic boolean onLongClick(View view) {ResultadoBuscaMapa.this.finish();return true;}});I cannot compile, and get this errorUNEXPECTED TOP-LEVEL EXCEPTION: com.android.dx.util.ExceptionWithContext at com.android.dx.util.ExceptionWithContext.withContext(ExceptionWithContext.java:46) …in both Intellij IDEA and Android Studio (latest versions)Funny thing is that i

  • RAHULRSANNIDHI
    android facebook
    I’m developing an Android app that should integrate with Facebook sdk v3.5.2I have gone through official guide and integrated the share dialog in my application. i have implemented everything correctly with the Facebook sdk when i try to share a link from my application to the facebook application .Iam getting an exception like.D/com.facebook.AppEventsLogger(13656): Got unexpected exception: java.lang.NullPointerException.also i added the meta tag in manifest filemeta-dataandroid:name=”com.face

  • Kevin B
    javascript html5 socket.io
    I’ve been using socket.io to act as a server which was working fine. However, I am getting the “unexpected token <” error when adding the line <script src=”client files\MainMenu.js”></script>to my index.html that connects to the server. This error only occurs in chrome and will run if the aforementioned line is removed. Strangely though, this error won’t appear in firefox but instead I’ll get errors to do with socket.io.js (which I haven’t touched personally). Also I’ve also succe

  • Crucial
    javascript jquery html5 canvas
    I am making a small draw pad script using HTML5 canvas and JS.I encountered a problem which I think maybe be caused by using 2 ‘mouseup’ event listeners but I am not certain – so I was wondering if someone could take a look at the code.The problem is that when dragging the brush size slider, if not letting go of the mouse while still hovering over the slider – the first line you try to draw on the canvas gets stopped half way.Actual link: www.ronjrtech.com/drawPastebin: http://pastebin.com/hCbPk

  • Dominic Sore
    javascript html5 setinterval keydown
    So I am at the very beginning stages of creating my first platform style game in html5.So far I have only implemented left and right movement and no ‘gravity’ or collision detection is at play.However, I’ve already hit an issue.If you go left or right for a short period of time the ‘character’ acts as intended (I use character loosely as it’s the map that is actually moving). If, however, you hold the key down the map moves too fast.I figure the issue is that the keydown event listener is listen

  • Bill Mills
    javascript css html5
    I’ve spent the day on a funny problem – I have some canvases that I’d like to drag around using native HTML5 drag and drop functionality. Everything works great, except I eventually found that in Chrome 28.0.1500.95, the default ghost image of the canvas doesn’t appear if the canvas is the child of an inline-block div. Check out this minimal working example:<html><body><div style=’display:inline-block’> <canvas id=’canvas1′ width=’100px’ height=’100px’ draggable=’true’>

  • qiu8310
    html5 canvas
    When I want to draw lines that through three points, and make a round corner at the second point. And then problem happens, if the angle between the two line is less than 90 degree, there will be some extra line append on the line through point1 and point2. if the angle large or equal 90 degree, it will be ok.You can see this in fiddle: http://jsfiddle.net/qiu8310/8cFZG/2/And here is the javascript code and the result:”use strict”;function Point(x, y){this.x = x ? x : 0;this.y = y ? y : 0;}var c

  • niko
    web-development html css html5
    I am new to HTML and Im working on a self made project and I have to use < table > and < fieldset > tags in my html files. I need to set the width and height properties to the tables like <td width=”100″ height=”200″ > </td> <!– something like that –>But Im afraid of these reason because as the Monitor size changes with the computers some have large screens and some have small screens like notebook pc’s. The table dimensions looks small for the big screen computers and

  • Chris Johnson
    html5 canvas drawimage
    I’m just learning how to use the HTML5 canvas element. I’ve been successful in drawing rectangles, calling getImageData, manipulating pixels and then putImageData to see the rectangles change colour, etc.Now I’m trying to load an image into the canvas I’ve hit a snag. After calling drawImage on the canvas’s context, fillRect only draws in areas that don’t have an image drawn into them, like it’s drawing the rectangles behind the images, even though it’s called after drawImage. Also, putImageData

  • Deepsy
    javascript html5 angularjs angularjs-ng-repeat angular-ng-if
    I have an object that looks like this:So basically I don’t know the length of the object and I’m using the following code to render the result:<table style=”width: 100%” border=”0″ cellpadding=”0″ cellspacing=”0″><tr ng-repeat-start=”(key, item) in items() track by key” ng-if=”item.primary”></tr><td first someprop=”2″>first</td> <tr ng-repeat-end ng-if=”!item.primary”><td>[NOT] first</tr></tr> </table>I want the first element in the tab

  • James Montagne
    html css html5 css3
    Can somebody please help me understand why I am seeing what I am seeing?Code:<!doctype html> <html lang=”en”><head><style>#Viewport { width:50%; height:50%; margin: 0 auto; position: relative; background-color: blue; }#one { position: absolute; width: 5%; height: 70%; background-color: green;}#two { width: 5%; float: right; }</style></head><body><div id=”Viewport”><section id=”one”><p>hi</p></section><section id=”two”>

  • Jens Ravens
    css html5 font-face linewrap
    On a new project I get some unexpected behavior: When the sidebar is quite small (about 200px) , line breaks occur earlier than needed.On this image you can see the result (Safari 6.0.2, similar results in other brothers), the left arrow where the word is, the right arrow where the word should be (in my opinion).You can find the whole website http://fitzskoglund.jensravens.de to the see effect and CSS.I cannot attach a special snippet because I don’t know where this style or behavior comes from.

  • bbullis
    jquery android ajax mobile phonegap
    I have been reading all over trying to find a reason why my AJAX, getJSON callback, JSONP and POST calls to my web server from my mobile phonegap android app is not working. I have tried every trick in the book and all of them work perfectly when using a standard web browser. Has anyone come across the …Uncaught SyntaxtError: Unexpected token < at http://www.google.com.. error before? I have <uses-permission android:name=”android.permission.INTERNET” /> in my AndroidManifest.xml.An

  • Danny
    iphone ios xcode ipad phonegap
    I just created a new phone gap project in Xcode following the step-by-step guide on phone gap and with the default template files it creates I get this error. Does anyone know what this is or how to fix it? It is supposed to be able to build without error the default template project after building but I get this:Unexpected ‘@’ in program – line 68 CDVNotification.m[self showDialogWithMessage:message title:title buttons:@[buttons] callbackId:callbackId dialogType:DIALOG_TYPE_ALERT];Unexpected ‘@

  • Michael Berkowski
    javascript android html phonegap syntax
    I am getting the error as stated in the title.Here is the html code<!DOCTYPE HTML> <html><head><title> PhoneGap </title><script type=”text/javascript” charset=”utf-8″ src=”cordova-2.3.0.js”></script><script type=”text/javascript” charset=”utf-8″ src=”fileopener.js”></script></head><body><h1>PDF Open Tester</h1><a href=”#” onclick=”window.plugins.fileOpener.open(“/sdcard/Course Content Files/1.pdf”);”>open</a&g

  • Paul Beusterien
    javascript android html phonegap android-webview
    In my PhoneGap Eclipse project I am using jQuery for visual effects by referencing jQuery libraries:<link rel=”stylesheet”href=”http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.css” /><script type=”text/javascript” src=”http://code.jquery.com/jquery.js”></script><script type=”text/javascript”src=”http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.js”></script>and I am also making remote domain requests in order to display some information from the remote server.

  • Coder_sLaY
    android phonegap
    Note:- I am using Cordova 1.9.0 and JQM 1.1.0, I am testing on Android 2.3This is my ChildBrowser.javaimport java.io.IOException; import java.io.InputStream;import org.apache.cordova.api.Plugin; import org.apache.cordova.api.PluginResult; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject;import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Bitmap; import android

  • Axel Gong
    wcf phonegap iis-7
    First, I consumed WCF service in my asp.net application, everything is ok. But it does not work in my phonegap application. Here is my detailed error message. (First two are warnings and last one is error.) Warning 1: Viewport target-densitydpi is not supported. index.html:7 Warning 2: Resource interpreted as Script but transferred with MIME type text/html: “http://:64514/Service1.svc?wsdl/MyFunction&callback=jQuery1900010203775251284242_1364550121569&Count1&_=1364550121570”. Erro

  • Luka
    android phonegap
    My application works fine in emulator, but when I put it on my Android device (Samsung Galaxy Spica) I get error: The page at file:// says: gap:[“Device”,”getDeviceInfo”,”Device0″,true]<!DOCTYPE HTML> <html> <head> <meta charset=”utf-8″> <title>Title</title><meta charset=”utf-8″><script type=”text/javascript” src=”javascript/phonegap.js”></script><script type=”text/javascript”>alert(“test1″);</script> <link rel=”stylesheet” hre

  • akjoshi
    phonegap extjs touch
    Running my Sencha 2 app in Chrome, I have a store with a rest proxy and a reader of type json. The store fetches data from a web service and the returned json is:{“user”:{“distributionRespondentId”:”71″,”loginId”:”01000368_95655233_71″,”remoteId”:”90″,”name”:”Tycho Brahe”,”companyId”:1000368,”companyName”:”MickTest3″,”pin”:”60075826″}}which, according to JsonLint, is fine and the Sencha 2 app running in Chrome is quite happy with it.I have eclipse set up with Applaud and put my Sencha 2 app in t

  • Lex
    javascript phonegap cordova cordova-2.0.0 ripple
    I’m using PhoneGap 2.7.0 and am following the simple command line build/install instructions here. I’m building for Android, on Windows. My debugging and testing is mostly done in Chrome using Ripple, but also using the Android emulator and installed on my Nexus 7. First, I’ll say what works. For a simple ondeviceready javascript code of the kind shown here in the PhoneGap documentation everything works great in Chrome, in the emulator, and on the device. I use the command-line method of buildin

  • ninetwozero
    android json api phonegap jquery-mobile
    I tried to put a an Android phonegap app with WP serving content. while phonegap app running JQM framework. I did this a couple of time and it worked fine.However, in this new app i did, i had this uncaught syntaxerror unexpected token < My codes to retrieve jsonfunction loadWPCatIndex() {$.getJSON(“http://www.skywin.my/?json=get_category_index&callback=?”, function(data){console.log(data);plistmenu = $(‘#product_list’);$.each(data.categories.reverse(), function(i, item) {categoriesID[i]

Web site is in building

I discovery a place to host code、demo、 blog and websites.
Site access is fast but not money