I'm relatively new to PhoneGap Android, I've an iPhone application and need to migrate to Android one I've added www from iPhone application to my Android application and added the permissions to manifest as well and even copied the XML folder with config.xml and cordova.xml but the problem is that my device ready function is not getting called
Here is my code for index.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link
href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css"
rel="stylesheet" />
<script src="scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<link href="css/style.css" type="text/css" rel="stylesheet" />
<link href="css/index.css" type="text/css" rel="stylesheet" />
<script src="scripts/app.js" type="text/javascript"></script>
<script type="text/javascript"
src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript"
src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script>
<script src="scripts/gallery_handler.js" type="text/javascript"></script>
<script src="scripts/itpoverlay.js" type="text/javascript"></script>
<script src="scripts/sqlite.js" type="text/javascript"></script>
<script src="scripts/jquery.exif.js" type="text/javascript"></script>
</head>
<body id="body">
<div class="app" style="display: none;">
<div id="deviceready">
<p class="status pending blink">Connecting to Device</p>
<p class="status complete blink hide">Device is Ready</p>
</div>
</div>
<div data-role="page" id="gallerypage" data-theme="a">
<div data-role="header">
<h1 class="headtitle">NG DESIIGNS</h1>
</div>
<div data-role="content" id="pagecontent">
<ul id="gallery" class="gallery">
</ul>
</div>
</div>
<script type="text/javascript" src="cordova-2.0.0.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
alert("app to be initialized");
app.initialize();
document.addEventListener('deviceready', function() {
alert("device ready called");
db.transaction(queryDB, errorCB, successCB);
}, false);
document.addEventListener("offline", function() {
alert("Your Device is offline");
}, false);
</script>
</body>
</html>
And here is index.js
var app = {
initialize: function() {
alert("index.js bind");
this.bind();
},
bind: function() {
alert("index.js bind function calld device ready");
document.addEventListener('deviceready', this.deviceready, false);
},
deviceready: function() {
alert("device ready");
// note that this is an event handler so the scope is that of the event
// so we need to call app.report(), and not this.report()
app.report('deviceready');
},
report: function(id) {
console.log("report:" + id);
// hide the .pending <p> and show the .complete <p>
document.querySelector('#' + id + ' .pending').className += ' hide';
var completeElem = document.querySelector('#' + id + ' .complete');
completeElem.className = completeElem.className.split('hide').join('');
}
};
Also see logcat
0-08 10:46:32.294: I/dalvikvm(763): threadid=3: reacting to signal 3
10-08 10:46:32.414: I/dalvikvm(763): Wrote stack traces to '/data/anr/traces.txt'
10-08 10:46:32.664: D/CordovaLog(763): Found preference for phonegap-version=2.0.0
10-08 10:46:32.673: D/CordovaLog(763): Found preference for orientation=default
10-08 10:46:32.673: D/CordovaLog(763): Found preference for target-device=universal
10-08 10:46:32.683: D/CordovaLog(763): Found preference for fullscreen=false
10-08 10:46:32.703: D/JsMessageQueue(763): Set native->JS mode to 1
10-08 10:46:32.803: I/dalvikvm(763): threadid=3: reacting to signal 3
10-08 10:46:32.873: I/dalvikvm(763): Wrote stack traces to '/data/anr/traces.txt'
10-08 10:46:32.934: W/webcore(763): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
10-08 10:46:32.934: W/webcore(763): at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1683)
10-08 10:46:32.934: W/webcore(763): at android.webkit.WebViewCore$EventHub.access$7900(WebViewCore.java:926)
10-08 10:46:32.934: W/webcore(763): at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1795)
10-08 10:46:32.934: W/webcore(763): at android.webkit.WebView.sendOurVisibleRect(WebView.java:2917)
10-08 10:46:32.934: W/webcore(763): at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:593)
10-08 10:46:32.934: W/webcore(763): at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
10-08 10:46:32.934: W/webcore(763): at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:984)
10-08 10:46:32.934: W/webcore(763): at android.os.Handler.handleCallback(Handler.java:605)
10-08 10:46:32.934: W/webcore(763): at android.os.Handler.dispatchMessage(Handler.java:92)
10-08 10:46:32.934: W/webcore(763): at android.os.Looper.loop(Looper.java:137)
10-08 10:46:32.934: W/webcore(763): at android.app.ActivityThread.main(ActivityThread.java:4424)
10-08 10:46:32.934: W/webcore(763): at java.lang.reflect.Method.invokeNative(Native Method)
10-08 10:46:32.934: W/webcore(763): at java.lang.reflect.Method.invoke(Method.java:511)
10-08 10:46:32.934: W/webcore(763): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
10-08 10:46:32.934: W/webcore(763): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
10-08 10:46:32.934: W/webcore(763): at dalvik.system.NativeStart.main(Native Method)
10-08 10:46:32.964: D/gralloc_goldfish(763): Emulator without GPU emulation detected.
10-08 10:46:33.823: D/dalvikvm(763): GC_CONCURRENT freed 115K, 3% free 6838K/7047K, paused 4ms+4ms
10-08 10:46:41.603: I/SqliteDatabaseCpp(763): sqlite returned: error code = 14, msg = cannot open file at line 27701 of [8609a15dfa], db=/data/data/com.example.phonegapapp/databases/webview.db
10-08 10:46:41.603: I/SqliteDatabaseCpp(763): sqlite returned: error code = 14, msg = os_unix.c: open() at line 27701 - "" errno=2 path=/CachedGeoposition.db, db=/data/data/com.example.phonegapapp/databases/webview.db
10-08 10:46:41.994: E/Cordova(763): Error loading url gap://ready
10-08 10:46:41.994: E/Cordova(763): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=gap://ready }
10-08 10:46:41.994: E/Cordova(763): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
10-08 10:46:41.994: E/Cordova(763): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
10-08 10:46:41.994: E/Cordova(763): at android.app.Activity.startActivityForResult(Activity.java:3190)
10-08 10:46:41.994: E/Cordova(763): at android.app.Activity.startActivity(Activity.java:3297)
10-08 10:46:41.994: E/Cordova(763): at org.apache.cordova.CordovaWebViewClient.shouldOverrideUrlLoading(CordovaWebViewClient.java:222)
10-08 10:46:41.994: E/Cordova(763): at android.webkit.CallbackProxy.uiOverrideUrlLoading(CallbackProxy.java:224)
10-08 10:46:41.994: E/Cordova(763): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:324)
10-08 10:46:41.994: E/Cordova(763): at android.os.Handler.dispatchMessage(Handler.java:99)
10-08 10:46:41.994: E/Cordova(763): at android.os.Looper.loop(Looper.java:137)
10-08 10:46:41.994: E/Cordova(763): at android.app.ActivityThread.main(ActivityThread.java:4424)
10-08 10:46:41.994: E/Cordova(763): at java.lang.reflect.Method.invokeNative(Native Method)
10-08 10:46:41.994: E/Cordova(763): at java.lang.reflect.Method.invoke(Method.java:511)
10-08 10:46:41.994: E/Cordova(763): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
10-08 10:46:41.994: E/Cordova(763): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
10-08 10:46:41.994: E/Cordova(763): at dalvik.system.NativeStart.main(Native Method)
10-08 10:46:43.553: E/libEGL(763): call to OpenGL ES API with no current context (logged once per thread)
10-08 10:46:43.553: D/ShaderProgram(763): couldn't load the vertex shader!
10-08 10:46:43.553: E/libEGL(763): call to OpenGL ES API with no current context (logged once per thread)
10-08 10:46:43.553: D/ShaderProgram(763): couldn't load the vertex shader!
10-08 10:46:43.553: E/libEGL(763): call to OpenGL ES API with no current context (logged once per thread)
10-08 10:46:43.553: D/ShaderProgram(763): couldn't load the vertex shader!
10-08 10:46:43.553: E/libEGL(763): call to OpenGL ES API with no current context (logged once per thread)
10-08 10:46:43.553: D/ShaderProgram(763): couldn't load the vertex shader!
10-08 10:46:43.553: E/libEGL(763): call to OpenGL ES API with no current context (logged once per thread)
10-08 10:46:43.553: D/ShaderProgram(763): couldn't load the vertex shader!
10-08 10:51:48.393: I/dalvikvm(828): threadid=3: reacting to signal 3
10-08 10:51:48.413: I/dalvikvm(828): Wrote stack traces to '/data/anr/traces.txt'
10-08 10:51:48.674: D/CordovaLog(828): Found preference for phonegap-version=2.0.0
10-08 10:51:48.694: D/CordovaLog(828): Found preference for orientation=default
10-08 10:51:48.694: D/CordovaLog(828): Found preference for target-device=universal
10-08 10:51:48.694: D/CordovaLog(828): Found preference for fullscreen=false
10-08 10:51:48.704: D/JsMessageQueue(828): Set native->JS mode to 1
10-08 10:51:48.893: I/dalvikvm(828): threadid=3: reacting to signal 3
10-08 10:51:48.934: W/webcore(828): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
10-08 10:51:48.934: W/webcore(828): at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1683)
10-08 10:51:48.934: W/webcore(828): at android.webkit.WebViewCore$EventHub.access$7900(WebViewCore.java:926)
10-08 10:51:48.934: W/webcore(828): at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1795)
10-08 10:51:48.934: W/webcore(828): at android.webkit.WebView.sendOurVisibleRect(WebView.java:2917)
10-08 10:51:48.934: W/webcore(828): at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:593)
10-08 10:51:48.934: W/webcore(828): at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
10-08 10:51:48.934: W/webcore(828): at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:984)
10-08 10:51:48.934: W/webcore(828): at android.os.Handler.handleCallback(Handler.java:605)
10-08 10:51:48.934: W/webcore(828): at android.os.Handler.dispatchMessage(Handler.java:92)
10-08 10:51:48.934: W/webcore(828): at android.os.Looper.loop(Looper.java:137)
10-08 10:51:48.934: W/webcore(828): at android.app.ActivityThread.main(ActivityThread.java:4424)
10-08 10:51:48.934: W/webcore(828): at java.lang.reflect.Method.invokeNative(Native Method)
10-08 10:51:48.934: W/webcore(828): at java.lang.reflect.Method.invoke(Method.java:511)
10-08 10:51:48.934: W/webcore(828): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
10-08 10:51:48.934: W/webcore(828): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
10-08 10:51:48.934: W/webcore(828): at dalvik.system.NativeStart.main(Native Method)
10-08 10:51:48.954: D/gralloc_goldfish(828): Emulator without GPU emulation detected.
10-08 10:51:48.954: I/dalvikvm(828): Wrote stack traces to '/data/anr/traces.txt'
10-08 10:51:49.764: D/dalvikvm(828): GC_CONCURRENT freed 119K, 3% free 6839K/7047K, paused 4ms+3ms
10-08 10:52:10.864: I/SqliteDatabaseCpp(828): sqlite returned: error code = 14, msg = cannot open file at line 27701 of [8609a15dfa], db=/data/data/com.example.phonegapapp/databases/webview.db
10-08 10:52:10.874: I/SqliteDatabaseCpp(828): sqlite returned: error code = 14, msg = os_unix.c: open() at line 27701 - "" errno=2 path=/CachedGeoposition.db, db=/data/data/com.example.phonegapapp/databases/webview.db
10-08 10:52:11.233: E/Cordova(828): Error loading url gap://ready
10-08 10:52:11.233: E/Cordova(828): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=gap://ready }
10-08 10:52:11.233: E/Cordova(828): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
10-08 10:52:11.233: E/Cordova(828): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
10-08 10:52:11.233: E/Cordova(828): at android.app.Activity.startActivityForResult(Activity.java:3190)
10-08 10:52:11.233: E/Cordova(828): at android.app.Activity.startActivity(Activity.java:3297)
10-08 10:52:11.233: E/Cordova(828): at org.apache.cordova.CordovaWebViewClient.shouldOverrideUrlLoading(CordovaWebViewClient.java:222)
10-08 10:52:11.233: E/Cordova(828): at android.webkit.CallbackProxy.uiOverrideUrlLoading(CallbackProxy.java:224)
10-08 10:52:11.233: E/Cordova(828): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:324)
10-08 10:52:11.233: E/Cordova(828): at android.os.Handler.dispatchMessage(Handler.java:99)
10-08 10:52:11.233: E/Cordova(828): at android.os.Looper.loop(Looper.java:137)
10-08 10:52:11.233: E/Cordova(828): at android.app.ActivityThread.main(ActivityThread.java:4424)
10-08 10:52:11.233: E/Cordova(828): at java.lang.reflect.Method.invokeNative(Native Method)
10-08 10:52:11.233: E/Cordova(828): at java.lang.reflect.Method.invoke(Method.java:511)
10-08 10:52:11.233: E/Cordova(828): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
10-08 10:52:11.233: E/Cordova(828): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
10-08 10:52:11.233: E/Cordova(828): at dalvik.system.NativeStart.main(Native Method)
10-08 10:52:12.824: E/libEGL(828): call to OpenGL ES API with no current context (logged once per thread)
10-08 10:52:12.824: D/ShaderProgram(828): couldn't load the vertex shader!
10-08 10:52:12.824: E/libEGL(828): call to OpenGL ES API with no current context (logged once per thread)
10-08 10:52:12.824: D/ShaderProgram(828): couldn't load the vertex shader!
10-08 10:52:12.824: E/libEGL(828): call to OpenGL ES API with no current context (logged once per thread)
10-08 10:52:12.824: D/ShaderProgram(828): couldn't load the vertex shader!
10-08 10:52:12.834: E/libEGL(828): call to OpenGL ES API with no current context (logged once per thread)
10-08 10:52:12.834: D/ShaderProgram(828): couldn't load the vertex shader!
10-08 10:52:12.834: E/libEGL(828): call to OpenGL ES API with no current context (logged once per thread)
10-08 10:52:12.834: D/ShaderProgram(828): couldn't load the vertex shader!
You have to change the cordova.js in your www folder to the one of android cordova.js
This is wher the error is being caused:
10-08 10:46:41.994: E/Cordova(763): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=gap://ready }
The system is not able to find an intent that will handle the display of data by calling the deviceReady() function. This leads me to beleive you might have an error in your project setup.
Double check if you have set everything up using this guide
Make sure you have reversed any iphone specific changes you might have made to your setup files etc whenmigrating your code form ios to android.
Related
I am getting the following error in nexus 5 when I play the video for 5-10 minutes.This error is not occurring always.It is working in nexus 9 and samsung duos.
10-08 09:03:14.033 14588-14599 W/AudioSystem﹕ AudioFlinger server died!
10-08 09:03:14.033 14588-14778 W/IMediaDeathNotifier﹕ media server died
10-08 09:03:14.043 14588-14778 E/MediaPlayer﹕ error (100, 0)
10-08 09:03:14.043 14588-14588 D/AndroidRuntime﹕ Shutting down VM
10-08 09:03:14.043 14588-14588 W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41849ba8)
10-08 09:03:14.043 14588-14588 E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: , PID: 14588
java.lang.RuntimeException: failure code: -32
at android.media.MediaPlayer.invoke(MediaPlayer.java:664)
at android.media.MediaPlayer.getInbandTrackInfo(MediaPlayer.java:1692)
at android.media.MediaPlayer.scanInternalSubtitleTracks(MediaPlayer.java:1851)
at android.media.MediaPlayer.access$600(MediaPlayer.java:529)
at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:2198)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
It is working in nexus 5 emulator also.What might be the problem?and how to solve it?
Main reasons is memory issues, second could be mutlithread access on MediaPlayer. Do you have the code so we can elaborate more?
I have a neo4j server running on my laptop on the port 7474. It is enabled to listen on localhost:7474/ , 0.0.0.0:7474/ and :7474/. I am referring to the official documentation on the Community Documentation Page - http://docs.neo4j.org/chunked/milestone/server-java-rest-client-example.html.
I am trying to connect to the database and create a node through an android app.
I have added the jersey-bundle-1.8.jar in my app's libs folder. I am able to use all the functions defined in the library. No errors are reported for calling the functions.
Using the documentation, i am able to connect to the neo4j server running on my laptop as shown in the picture.
ISSUE FACED :
So moving ahead, i clicked the button to create a node, again picking the code from the reference page mentioned above.
What happened was that the app crashed and raised exceptions (as shown in the picture). The exceptions raised are attached in log
03-28 17:50:05.691: I/SurfaceTextureClient(10165): [STC::queueBuffer] (this:0x5cc8a588) fps:0.09, dur:10766.62, max:10766.62, min:10766.62
03-28 17:50:05.691: I/SurfaceTextureClient(10165): [STC::queueBuffer] this:0x5cc8a588, api:1, last queue time elapsed:10766.62
03-28 17:50:05.709: D/dalvikvm(10165): GC_CONCURRENT freed 272K, 16% free 5656K/6664K, paused 2ms+2ms, total 27ms
03-28 17:50:05.747: V/Provider/Settings(10165): invalidate [system]: current 208 != cached 0
03-28 17:50:05.750: V/Provider/Settings(10165): from db cache, name = sound_effects_enabled , value = 0
03-28 17:50:05.751: D/dalvikvm(10165): create interp thread : stack size=32KB
03-28 17:50:05.751: D/dalvikvm(10165): create new thread
03-28 17:50:05.751: D/dalvikvm(10165): new thread created
03-28 17:50:05.751: D/dalvikvm(10165): update thread list
03-28 17:50:05.751: D/dalvikvm(10165): threadid=12: interp stack at 0x5e2ef000
03-28 17:50:05.751: D/dalvikvm(10165): threadid=12: created from interp
03-28 17:50:05.751: D/dalvikvm(10165): start new thread
03-28 17:50:05.751: D/dalvikvm(10165): threadid=12: notify debugger
03-28 17:50:05.751: D/dalvikvm(10165): threadid=12 (AsyncTask #1): calling run()
03-28 17:50:05.768: I/dalvikvm(10165): Failed resolving Lcom/sun/jersey/core/osgi/OsgiRegistry; interface 2320 'Lorg/osgi/framework/SynchronousBundleListener;'
03-28 17:50:05.768: W/dalvikvm(10165): Link of class 'Lcom/sun/jersey/core/osgi/OsgiRegistry;' failed
03-28 17:50:05.768: I/dalvikvm(10165): Could not find method com.sun.jersey.core.osgi.OsgiRegistry.getInstance, referenced from method com.sun.jersey.core.reflection.ReflectionHelper.getOsgiRegistryInstance
03-28 17:50:05.768: W/dalvikvm(10165): VFY: unable to resolve static method 7747: Lcom/sun/jersey/core/osgi/OsgiRegistry;.getInstance ()Lcom/sun/jersey/core/osgi/OsgiRegistry;
03-28 17:50:05.768: D/dalvikvm(10165): VFY: replacing opcode 0x71 at 0x0008
03-28 17:50:05.769: I/dalvikvm(10165): Failed resolving Lcom/sun/jersey/core/osgi/OsgiRegistry; interface 2320 'Lorg/osgi/framework/SynchronousBundleListener;'
03-28 17:50:05.769: W/dalvikvm(10165): Link of class 'Lcom/sun/jersey/core/osgi/OsgiRegistry;' failed
03-28 17:50:05.770: W/dalvikvm(10165): VFY: unable to find class referenced in signature (Lcom/sun/jersey/core/osgi/OsgiRegistry;)
03-28 17:50:05.835: D/dalvikvm(10165): GC_CONCURRENT freed 359K, 17% free 5690K/6784K, paused 3ms+3ms, total 20ms
03-28 17:50:05.862: D/dalvikvm(10165): create interp thread : stack size=32KB
03-28 17:50:05.862: D/dalvikvm(10165): create new thread
03-28 17:50:05.862: D/dalvikvm(10165): new thread created
03-28 17:50:05.862: D/dalvikvm(10165): update thread list
03-28 17:50:05.862: D/dalvikvm(10165): threadid=13: interp stack at 0x5e2fb000
03-28 17:50:05.862: D/dalvikvm(10165): threadid=13: created from interp
03-28 17:50:05.863: D/dalvikvm(10165): start new thread
03-28 17:50:05.863: D/dalvikvm(10165): threadid=12: exiting
03-28 17:50:05.863: W/dalvikvm(10165): threadid=12: thread exiting with uncaught exception (group=0x41dba9a8)
03-28 17:50:05.863: W/System.err(10165): java.util.concurrent.ExecutionException: com.sun.jersey.api.client.ClientHandlerException: com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type, class java.lang.String, and MIME media type, application/json, was not found
03-28 17:50:05.864: D/dalvikvm(10165): threadid=13: notify debugger
03-28 17:50:05.864: W/System.err(10165): at java.util.concurrent.FutureTask.report(FutureTask.java:94)
03-28 17:50:05.864: D/dalvikvm(10165): threadid=13 (AsyncTask #2): calling run()
03-28 17:50:05.865: W/System.err(10165): at java.util.concurrent.FutureTask.get(FutureTask.java:160)
03-28 17:50:05.865: W/System.err(10165): at android.os.AsyncTask.get(AsyncTask.java:482)
03-28 17:50:05.865: W/System.err(10165): at com.example.neo4j.MainActivity$2.onClick(MainActivity.java:50)
03-28 17:50:05.865: W/System.err(10165): at android.view.View.performClick(View.java:4209)
03-28 17:50:05.865: W/System.err(10165): at android.view.View$PerformClick.run(View.java:17431)
03-28 17:50:05.866: W/System.err(10165): at android.os.Handler.handleCallback(Handler.java:725)
03-28 17:50:05.866: W/System.err(10165): at android.os.Handler.dispatchMessage(Handler.java:92)
03-28 17:50:05.866: W/System.err(10165): at android.os.Looper.loop(Looper.java:153)
03-28 17:50:05.866: W/System.err(10165): at android.app.ActivityThread.main(ActivityThread.java:5297)
03-28 17:50:05.866: W/System.err(10165): at java.lang.reflect.Method.invokeNative(Native Method)
03-28 17:50:05.866: W/System.err(10165): at java.lang.reflect.Method.invoke(Method.java:511)
03-28 17:50:05.866: W/System.err(10165): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
03-28 17:50:05.867: W/System.err(10165): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
03-28 17:50:05.867: W/System.err(10165): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:115)
03-28 17:50:05.867: W/System.err(10165): at dalvik.system.NativeStart.main(Native Method)
03-28 17:50:05.867: W/System.err(10165): Caused by: com.sun.jersey.api.client.ClientHandlerException: com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type, class java.lang.String, and MIME media type, application/json, was not found
03-28 17:50:05.868: W/System.err(10165): at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:155)
03-28 17:50:05.868: W/System.err(10165): at com.sun.jersey.api.client.Client.handle(Client.java:652)
03-28 17:50:05.868: W/System.err(10165): at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
03-28 17:50:05.869: W/System.err(10165): at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
03-28 17:50:05.869: W/System.err(10165): at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:560)
03-28 17:50:05.869: W/System.err(10165): at com.example.neo4j.RESTCreateNode.doInBackground(RESTCreateNode.java:33)
03-28 17:50:05.869: W/System.err(10165): at com.example.neo4j.RESTCreateNode.doInBackground(RESTCreateNode.java:1)
03-28 17:50:05.869: W/System.err(10165): at android.os.AsyncTask$2.call(AsyncTask.java:287)
03-28 17:50:05.869: W/System.err(10165): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
03-28 17:50:05.870: W/System.err(10165): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
03-28 17:50:05.870: W/System.err(10165): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
03-28 17:50:05.870: W/System.err(10165): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
03-28 17:50:05.870: W/System.err(10165): at java.lang.Thread.run(Thread.java:838)
03-28 17:50:05.870: W/System.err(10165): Caused by: com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type, class java.lang.String, and MIME media type, application/json, was not found
03-28 17:50:05.871: W/System.err(10165): at com.sun.jersey.api.client.RequestWriter.writeRequestEntity(RequestWriter.java:288)
03-28 17:50:05.871: W/System.err(10165): at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:217)
03-28 17:50:05.871: W/System.err(10165): at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:153)
03-28 17:50:05.871: W/System.err(10165): ... 12 more
03-28 17:50:05.879: E/AndroidRuntime(10165): FATAL EXCEPTION: AsyncTask #1
03-28 17:50:05.879: E/AndroidRuntime(10165): java.lang.RuntimeException: An error occured while executing doInBackground()
03-28 17:50:05.879: E/AndroidRuntime(10165): at android.os.AsyncTask$3.done(AsyncTask.java:299)
03-28 17:50:05.879: E/AndroidRuntime(10165): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
03-28 17:50:05.879: E/AndroidRuntime(10165): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
03-28 17:50:05.879: E/AndroidRuntime(10165): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
03-28 17:50:05.879: E/AndroidRuntime(10165): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
03-28 17:50:05.879: E/AndroidRuntime(10165): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
03-28 17:50:05.879: E/AndroidRuntime(10165): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
03-28 17:50:05.879: E/AndroidRuntime(10165): at java.lang.Thread.run(Thread.java:838)
03-28 17:50:05.879: E/AndroidRuntime(10165): Caused by: com.sun.jersey.api.client.ClientHandlerException: com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type, class java.lang.String, and MIME media type, application/json, was not found
03-28 17:50:05.879: E/AndroidRuntime(10165): at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:155)
03-28 17:50:05.879: E/AndroidRuntime(10165): at com.sun.jersey.api.client.Client.handle(Client.java:652)
03-28 17:50:05.879: E/AndroidRuntime(10165): at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
03-28 17:50:05.879: E/AndroidRuntime(10165): at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
03-28 17:50:05.879: E/AndroidRuntime(10165): at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:560)
03-28 17:50:05.879: E/AndroidRuntime(10165): at com.example.neo4j.RESTCreateNode.doInBackground(RESTCreateNode.java:33)
03-28 17:50:05.879: E/AndroidRuntime(10165): at com.example.neo4j.RESTCreateNode.doInBackground(RESTCreateNode.java:1)
03-28 17:50:05.879: E/AndroidRuntime(10165): at android.os.AsyncTask$2.call(AsyncTask.java:287)
03-28 17:50:05.879: E/AndroidRuntime(10165): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
03-28 17:50:05.879: E/AndroidRuntime(10165): ... 4 more
03-28 17:50:05.879: E/AndroidRuntime(10165): Caused by: com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type, class java.lang.String, and MIME media type, application/json, was not found
03-28 17:50:05.879: E/AndroidRuntime(10165): at com.sun.jersey.api.client.RequestWriter.writeRequestEntity(RequestWriter.java:288)
03-28 17:50:05.879: E/AndroidRuntime(10165): at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:217)
03-28 17:50:05.879: E/AndroidRuntime(10165): at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:153)
03-28 17:50:05.879: E/AndroidRuntime(10165): ... 12 more
03-28 17:50:06.425: D/OpenGLRenderer(10165): Flushing caches (mode 0)
03-28 17:50:06.654: D/OpenGLRenderer(10165): Flushing caches (mode 1)
03-28 17:50:06.666: D/OpenGLRenderer(10165): Flushing caches (mode 0)
I started googling the issue and found a solution proposed by user Lucas Ventura
here - http://jersey.576304.n2.nabble.com/java-lang-NullPointerException-on-Android-td4212447.html
I implemented the solution and it started giving me exception -
"NullPointerException at MediaType.java:119".
I tried googling further but it didn't yeild anything useful.
A little insight on this topic would help me a lot.
Please let me know if i am following something in a wrong manner. If not, is there any other approach that I can use to connect to neo4j server in a RESTful way.
Also let me know if this is the answer i am looking for -https://github.com/giorgio-zamparelli/jersey-android
I'm following this tutorial to get nearby location, I followed each and every step as per tutorial. But when I run my app, I'm getting following errors:
10-08 10:57:37.125: E/dalvikvm(758): Could not find class 'com.google.api.client.http.javanet.NetHttpTransport', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.<clinit>
10-08 10:57:37.475: E/dalvikvm(758): Could not find class 'com.androidhive.googleplacesandmaps.GooglePlaces$1', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.createRequestFactory
10-08 10:57:37.515: E/dalvikvm(758): Could not find class 'com.google.api.client.http.GenericUrl', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.getPlaceDetails
10-08 10:57:37.566: E/dalvikvm(758): Could not find class 'com.google.api.client.http.GenericUrl', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.search
10-08 10:57:37.645: E/AndroidRuntime(758): FATAL EXCEPTION: AsyncTask #1
10-08 10:57:37.645: E/AndroidRuntime(758): java.lang.RuntimeException: An error occured while executing doInBackground()
10-08 10:57:37.645: E/AndroidRuntime(758): at android.os.AsyncTask$3.done(AsyncTask.java:266)
10-08 10:57:37.645: E/AndroidRuntime(758): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
10-08 10:57:37.645: E/AndroidRuntime(758): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
10-08 10:57:37.645: E/AndroidRuntime(758): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
10-08 10:57:37.645: E/AndroidRuntime(758): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-08 10:57:37.645: E/AndroidRuntime(758): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
10-08 10:57:37.645: E/AndroidRuntime(758): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
10-08 10:57:37.645: E/AndroidRuntime(758): at java.lang.Thread.run(Thread.java:1020)
10-08 10:57:37.645: E/AndroidRuntime(758): Caused by: java.lang.ExceptionInInitializerError
10-08 10:57:37.645: E/AndroidRuntime(758): at com.androidhive.googleplacesandmaps.MainActivity$LoadPlaces.doInBackground(MainActivity.java:170)
10-08 10:57:37.645: E/AndroidRuntime(758): at com.androidhive.googleplacesandmaps.MainActivity$LoadPlaces.doInBackground(MainActivity.java:1)
10-08 10:57:37.645: E/AndroidRuntime(758): at android.os.AsyncTask$2.call(AsyncTask.java:252)
10-08 10:57:37.645: E/AndroidRuntime(758): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-08 10:57:37.645: E/AndroidRuntime(758): ... 4 more
10-08 10:57:37.645: E/AndroidRuntime(758): Caused by: java.lang.NoClassDefFoundError: com.google.api.client.http.javanet.NetHttpTransport
10-08 10:57:37.645: E/AndroidRuntime(758): at com.androidhive.googleplacesandmaps.GooglePlaces.<clinit>(GooglePlaces.java:23)
10-08 10:57:37.645: E/AndroidRuntime(758): ... 8 more
10-08 10:57:38.715: E/WindowManager(758): Activity com.androidhive.googleplacesandmaps.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#40936600 that was originally added here
10-08 10:57:38.715: E/WindowManager(758): android.view.WindowLeaked: Activity com.androidhive.googleplacesandmaps.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#40936600 that was originally added here
10-08 10:57:38.715: E/WindowManager(758): at android.view.ViewRoot.<init>(ViewRoot.java:288)
10-08 10:57:38.715: E/WindowManager(758): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:249)
10-08 10:57:38.715: E/WindowManager(758): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:193)
10-08 10:57:38.715: E/WindowManager(758): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:118)
10-08 10:57:38.715: E/WindowManager(758): at android.view.Window$LocalWindowManager.addView(Window.java:532)
10-08 10:57:38.715: E/WindowManager(758): at android.app.Dialog.show(Dialog.java:269)
10-08 10:57:38.715: E/WindowManager(758): at com.androidhive.googleplacesandmaps.MainActivity$LoadPlaces.onPreExecute(MainActivity.java:162)
10-08 10:57:38.715: E/WindowManager(758): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:549)
10-08 10:57:38.715: E/WindowManager(758): at android.os.AsyncTask.execute(AsyncTask.java:499)
10-08 10:57:38.715: E/WindowManager(758): at com.androidhive.googleplacesandmaps.MainActivity.onCreate(MainActivity.java:102)
10-08 10:57:38.715: E/WindowManager(758): at android.app.Activity.performCreate(Activity.java:4397)
10-08 10:57:38.715: E/WindowManager(758): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
10-08 10:57:38.715: E/WindowManager(758): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
10-08 10:57:38.715: E/WindowManager(758): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
10-08 10:57:38.715: E/WindowManager(758): at android.app.ActivityThread.access$500(ActivityThread.java:122)
10-08 10:57:38.715: E/WindowManager(758): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
10-08 10:57:38.715: E/WindowManager(758): at android.os.Handler.dispatchMessage(Handler.java:99)
10-08 10:57:38.715: E/WindowManager(758): at android.os.Looper.loop(Looper.java:132)
10-08 10:57:38.715: E/WindowManager(758): at android.app.ActivityThread.main(ActivityThread.java:4123)
10-08 10:57:38.715: E/WindowManager(758): at java.lang.reflect.Method.invokeNative(Native Method)
10-08 10:57:38.715: E/WindowManager(758): at java.lang.reflect.Method.invoke(Method.java:491)
10-08 10:57:38.715: E/WindowManager(758): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
10-08 10:57:38.715: E/WindowManager(758): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
10-08 10:57:38.715: E/WindowManager(758): at dalvik.system.NativeStart.main(Native Method)
10-08 11:04:08.085: E/dalvikvm(794): Could not find class 'com.google.api.client.http.javanet.NetHttpTransport', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.<clinit>
10-08 11:04:08.435: E/dalvikvm(794): Could not find class 'com.androidhive.googleplacesandmaps.GooglePlaces$1', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.createRequestFactory
10-08 11:04:08.485: E/dalvikvm(794): Could not find class 'com.google.api.client.http.GenericUrl', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.getPlaceDetails
10-08 11:04:08.655: E/dalvikvm(794): Could not find class 'com.google.api.client.http.GenericUrl', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.search
10-08 11:04:08.685: E/AndroidRuntime(794): FATAL EXCEPTION: AsyncTask #1
10-08 11:04:08.685: E/AndroidRuntime(794): java.lang.RuntimeException: An error occured while executing doInBackground()
10-08 11:04:08.685: E/AndroidRuntime(794): at android.os.AsyncTask$3.done(AsyncTask.java:266)
10-08 11:04:08.685: E/AndroidRuntime(794): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
10-08 11:04:08.685: E/AndroidRuntime(794): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
10-08 11:04:08.685: E/AndroidRuntime(794): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
10-08 11:04:08.685: E/AndroidRuntime(794): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-08 11:04:08.685: E/AndroidRuntime(794): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
10-08 11:04:08.685: E/AndroidRuntime(794): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
10-08 11:04:08.685: E/AndroidRuntime(794): at java.lang.Thread.run(Thread.java:1020)
10-08 11:04:08.685: E/AndroidRuntime(794): Caused by: java.lang.ExceptionInInitializerError
10-08 11:04:08.685: E/AndroidRuntime(794): at com.androidhive.googleplacesandmaps.MainActivity$LoadPlaces.doInBackground(MainActivity.java:170)
10-08 11:04:08.685: E/AndroidRuntime(794): at com.androidhive.googleplacesandmaps.MainActivity$LoadPlaces.doInBackground(MainActivity.java:1)
10-08 11:04:08.685: E/AndroidRuntime(794): at android.os.AsyncTask$2.call(AsyncTask.java:252)
10-08 11:04:08.685: E/AndroidRuntime(794): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-08 11:04:08.685: E/AndroidRuntime(794): ... 4 more
10-08 11:04:08.685: E/AndroidRuntime(794): Caused by: java.lang.NoClassDefFoundError: com.google.api.client.http.javanet.NetHttpTransport
10-08 11:04:08.685: E/AndroidRuntime(794): at com.androidhive.googleplacesandmaps.GooglePlaces.<clinit>(GooglePlaces.java:23)
10-08 11:04:08.685: E/AndroidRuntime(794): ... 8 more
10-08 11:04:09.786: E/WindowManager(794): Activity com.androidhive.googleplacesandmaps.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#409365d0 that was originally added here
10-08 11:04:09.786: E/WindowManager(794): android.view.WindowLeaked: Activity com.androidhive.googleplacesandmaps.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#409365d0 that was originally added here
10-08 11:04:09.786: E/WindowManager(794): at android.view.ViewRoot.<init>(ViewRoot.java:288)
10-08 11:04:09.786: E/WindowManager(794): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:249)
10-08 11:04:09.786: E/WindowManager(794): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:193)
10-08 11:04:09.786: E/WindowManager(794): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:118)
10-08 11:04:09.786: E/WindowManager(794): at android.view.Window$LocalWindowManager.addView(Window.java:532)
10-08 11:04:09.786: E/WindowManager(794): at android.app.Dialog.show(Dialog.java:269)
10-08 11:04:09.786: E/WindowManager(794): at com.androidhive.googleplacesandmaps.MainActivity$LoadPlaces.onPreExecute(MainActivity.java:162)
10-08 11:04:09.786: E/WindowManager(794): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:549)
10-08 11:04:09.786: E/WindowManager(794): at android.os.AsyncTask.execute(AsyncTask.java:499)
10-08 11:04:09.786: E/WindowManager(794): at com.androidhive.googleplacesandmaps.MainActivity.onCreate(MainActivity.java:102)
10-08 11:04:09.786: E/WindowManager(794): at android.app.Activity.performCreate(Activity.java:4397)
10-08 11:04:09.786: E/WindowManager(794): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
10-08 11:04:09.786: E/WindowManager(794): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
10-08 11:04:09.786: E/WindowManager(794): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
10-08 11:04:09.786: E/WindowManager(794): at android.app.ActivityThread.access$500(ActivityThread.java:122)
10-08 11:04:09.786: E/WindowManager(794): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
10-08 11:04:09.786: E/WindowManager(794): at android.os.Handler.dispatchMessage(Handler.java:99)
10-08 11:04:09.786: E/WindowManager(794): at android.os.Looper.loop(Looper.java:132)
10-08 11:04:09.786: E/WindowManager(794): at android.app.ActivityThread.main(ActivityThread.java:4123)
10-08 11:04:09.786: E/WindowManager(794): at java.lang.reflect.Method.invokeNative(Native Method)
10-08 11:04:09.786: E/WindowManager(794): at java.lang.reflect.Method.invoke(Method.java:491)
10-08 11:04:09.786: E/WindowManager(794): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
10-08 11:04:09.786: E/WindowManager(794): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
10-08 11:04:09.786: E/WindowManager(794): at dalvik.system.NativeStart.main(Native Method)
10-08 11:08:51.366: E/dalvikvm(826): Could not find class 'com.google.api.client.http.javanet.NetHttpTransport', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.<clinit>
10-08 11:08:51.806: E/dalvikvm(826): Could not find class 'com.androidhive.googleplacesandmaps.GooglePlaces$1', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.createRequestFactory
10-08 11:08:51.885: E/dalvikvm(826): Could not find class 'com.google.api.client.http.GenericUrl', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.getPlaceDetails
10-08 11:08:51.935: E/dalvikvm(826): Could not find class 'com.google.api.client.http.GenericUrl', referenced from method com.androidhive.googleplacesandmaps.GooglePlaces.search
10-08 11:08:52.035: E/AndroidRuntime(826): FATAL EXCEPTION: AsyncTask #1
10-08 11:08:52.035: E/AndroidRuntime(826): java.lang.RuntimeException: An error occured while executing doInBackground()
10-08 11:08:52.035: E/AndroidRuntime(826): at android.os.AsyncTask$3.done(AsyncTask.java:266)
10-08 11:08:52.035: E/AndroidRuntime(826): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
10-08 11:08:52.035: E/AndroidRuntime(826): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
10-08 11:08:52.035: E/AndroidRuntime(826): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
10-08 11:08:52.035: E/AndroidRuntime(826): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-08 11:08:52.035: E/AndroidRuntime(826): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
10-08 11:08:52.035: E/AndroidRuntime(826): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
10-08 11:08:52.035: E/AndroidRuntime(826): at java.lang.Thread.run(Thread.java:1020)
10-08 11:08:52.035: E/AndroidRuntime(826): Caused by: java.lang.ExceptionInInitializerError
10-08 11:08:52.035: E/AndroidRuntime(826): at com.androidhive.googleplacesandmaps.MainActivity$LoadPlaces.doInBackground(MainActivity.java:170)
10-08 11:08:52.035: E/AndroidRuntime(826): at com.androidhive.googleplacesandmaps.MainActivity$LoadPlaces.doInBackground(MainActivity.java:1)
10-08 11:08:52.035: E/AndroidRuntime(826): at android.os.AsyncTask$2.call(AsyncTask.java:252)
10-08 11:08:52.035: E/AndroidRuntime(826): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-08 11:08:52.035: E/AndroidRuntime(826): ... 4 more
10-08 11:08:52.035: E/AndroidRuntime(826): Caused by: java.lang.NoClassDefFoundError: com.google.api.client.http.javanet.NetHttpTransport
10-08 11:08:52.035: E/AndroidRuntime(826): at com.androidhive.googleplacesandmaps.GooglePlaces.<clinit>(GooglePlaces.java:23)
10-08 11:08:52.035: E/AndroidRuntime(826): ... 8 more
10-08 11:08:53.145: E/WindowManager(826): Activity com.androidhive.googleplacesandmaps.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#40936608 that was originally added here
10-08 11:08:53.145: E/WindowManager(826): android.view.WindowLeaked: Activity com.androidhive.googleplacesandmaps.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#40936608 that was originally added here
10-08 11:08:53.145: E/WindowManager(826): at android.view.ViewRoot.<init>(ViewRoot.java:288)
10-08 11:08:53.145: E/WindowManager(826): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:249)
10-08 11:08:53.145: E/WindowManager(826): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:193)
10-08 11:08:53.145: E/WindowManager(826): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:118)
10-08 11:08:53.145: E/WindowManager(826): at android.view.Window$LocalWindowManager.addView(Window.java:532)
10-08 11:08:53.145: E/WindowManager(826): at android.app.Dialog.show(Dialog.java:269)
10-08 11:08:53.145: E/WindowManager(826): at com.androidhive.googleplacesandmaps.MainActivity$LoadPlaces.onPreExecute(MainActivity.java:162)
10-08 11:08:53.145: E/WindowManager(826): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:549)
10-08 11:08:53.145: E/WindowManager(826): at android.os.AsyncTask.execute(AsyncTask.java:499)
10-08 11:08:53.145: E/WindowManager(826): at com.androidhive.googleplacesandmaps.MainActivity.onCreate(MainActivity.java:102)
10-08 11:08:53.145: E/WindowManager(826): at android.app.Activity.performCreate(Activity.java:4397)
10-08 11:08:53.145: E/WindowManager(826): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
10-08 11:08:53.145: E/WindowManager(826): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
10-08 11:08:53.145: E/WindowManager(826): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
10-08 11:08:53.145: E/WindowManager(826): at android.app.ActivityThread.access$500(ActivityThread.java:122)
10-08 11:08:53.145: E/WindowManager(826): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
10-08 11:08:53.145: E/WindowManager(826): at android.os.Handler.dispatchMessage(Handler.java:99)
10-08 11:08:53.145: E/WindowManager(826): at android.os.Looper.loop(Looper.java:132)
10-08 11:08:53.145: E/WindowManager(826): at android.app.ActivityThread.main(ActivityThread.java:4123)
10-08 11:08:53.145: E/WindowManager(826): at java.lang.reflect.Method.invokeNative(Native Method)
10-08 11:08:53.145: E/WindowManager(826): at java.lang.reflect.Method.invoke(Method.java:491)
10-08 11:08:53.145: E/WindowManager(826): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
10-08 11:08:53.145: E/WindowManager(826): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
10-08 11:08:53.145: E/WindowManager(826): at dalvik.system.NativeStart.main(Native Method)
I searched to solve errors, but can't succeeded. How can I overcome those errors?
Or Can anyone provide me better solution to find nearby location?
Your jars are not being added properly. You must explicit add library reference of google-http-client-1.5.0-beta.jar(right click project->Properties->Java Build Path->Add External JARs), don't believe class path. If you do not do this, in the apk file does not contain the required data.
You can download Google plus library from here
Hmm... not working...??? Make sure one more thing as in pic that all options are checked e.g :
Decided to use Scandit SDK to get the barcode scanning feature in my app. Unfortunately, since I'm relatively new to Android development and Java in general I've run into a few issues that I can't seem to work out. The demo that Scandit provided doesn't give any errors(runs fine) but crashes when I try to start it up (pressing a button from one activity is meant to start it up). I've tried reading the logcat and googling a solution to the problems but I'm not getting the right solutions. Does anyone have an idea of what I'm doing wrong?
Logcat is provided below:
10-08 23:30:00.807 21563-21563/com.kwesimbia.management D/AndroidRuntime? Shutting down VM
10-08 23:30:00.807 21563-21563/com.kwesimbia.management W/dalvikvm? threadid=1: thread exiting with uncaught exception (group=0x40aa4228)
10-08 23:30:00.817 21563-21563/com.kwesimbia.management E/AndroidRuntime? FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3082)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com.kwesimbia.management.ScanditSDKDemoSimple
at com.kwesimbia.management.Activity_D.initiateCodeScan(Activity_D.java:63)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Process: com.kwesimbia.management
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Package: com.kwesimbia.management v1 (1.0)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger?
Application Label: firstapp
10-08 23:30:00.827 32726-587/? W/ActivityManager?
Force finishing activity com.kwesimbia.management/.Activity_D
I came across this problem as well, my solution was to extract the library files and put them as their files in the lib folder
The library basically isn't being exported with it
EDIT
So I checked out my project, basically I did these things:
In the libs folder I have a new folder called armeabi and inside that I have libscanditsdk-android-3.3.1.so
Then in my build path I have also referenced the jar file that they provide:
<classpathentry exported="true" kind="lib" path="C:/GIT/Android/FwayScannerProject/FwayScanner/libs/scanditsdk-barcodepicker-android-3.3.1.jar"/>
I use below code from Using Google Maps in Android to create app with googlemaps api but exceptions error.
mapView = (MapView) findViewById(R.id.mapView);
LinearLayout zoomLayout = (LinearLayout) findViewById(R.id.zoom);
View zoomView = mapView.getZoomControls();
zoomLayout.removeAllViews();
zoomLayout.addView(zoomView, new LinearLayout.LayoutParams(
android.widget.LinearLayout.LayoutParams.WRAP_CONTENT,
android.widget.LinearLayout.LayoutParams.WRAP_CONTENT));
mapView.displayZoomControls(true);
mapView are defined as private in public class MapsActivity extends MapActivity.
at View zoomView = mapView.getZoomControls(); eclipse show this warning : The method getZoomControls() from the type MapView is deprecated
logCat is:
10-08 15:27:47.606: D/dalvikvm(428): GC_FOR_MALLOC freed 4774 objects / 299864 bytes in 88ms
10-08 15:27:47.826: D/dalvikvm(428): GC_FOR_MALLOC freed 9901 objects / 603608 bytes in 68ms
10-08 15:27:48.016: D/dalvikvm(428): GC_FOR_MALLOC freed 4954 objects / 323936 bytes in 67ms
10-08 15:27:48.226: D/dalvikvm(428): GC_FOR_MALLOC freed 6199 objects / 378152 bytes in 67ms
10-08 15:27:48.466: D/dalvikvm(428): GC_FOR_MALLOC freed 8551 objects / 651664 bytes in 63ms
10-08 15:27:48.676: D/dalvikvm(428): GC_FOR_MALLOC freed 6074 objects / 370080 bytes in 60ms
10-08 15:27:48.716: D/AndroidRuntime(428): Shutting down VM
10-08 15:27:48.716: W/dalvikvm(428): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-08 15:27:48.736: E/AndroidRuntime(428): FATAL EXCEPTION: main
10-08 15:27:48.736: E/AndroidRuntime(428): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.avizhegroup.googlemaps/com.avizhegroup.googlemaps.MapsActivity}: android.view.InflateException: Binary XML file line #14: Error inflating class linearLayout
10-08 15:27:48.736: E/AndroidRuntime(428): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.os.Handler.dispatchMessage(Handler.java:99)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.os.Looper.loop(Looper.java:123)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-08 15:27:48.736: E/AndroidRuntime(428): at java.lang.reflect.Method.invokeNative(Native Method)
10-08 15:27:48.736: E/AndroidRuntime(428): at java.lang.reflect.Method.invoke(Method.java:521)
10-08 15:27:48.736: E/AndroidRuntime(428): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-08 15:27:48.736: E/AndroidRuntime(428): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-08 15:27:48.736: E/AndroidRuntime(428): at dalvik.system.NativeStart.main(Native Method)
10-08 15:27:48.736: E/AndroidRuntime(428): Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class linearLayout
10-08 15:27:48.736: E/AndroidRuntime(428): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
10-08 15:27:48.736: E/AndroidRuntime(428): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.app.Activity.setContentView(Activity.java:1647)
10-08 15:27:48.736: E/AndroidRuntime(428): at com.avizhegroup.googlemaps.MapsActivity.onCreate(MapsActivity.java:33)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
10-08 15:27:48.736: E/AndroidRuntime(428): ... 11 more
10-08 15:27:48.736: E/AndroidRuntime(428): Caused by: java.lang.ClassNotFoundException: android.view.linearLayout in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.avizhegroup.googlemaps-1.apk]
10-08 15:27:48.736: E/AndroidRuntime(428): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
10-08 15:27:48.736: E/AndroidRuntime(428): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
10-08 15:27:48.736: E/AndroidRuntime(428): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
10-08 15:27:48.736: E/AndroidRuntime(428): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
10-08 15:27:48.736: E/AndroidRuntime(428): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
10-08 15:27:48.736: E/AndroidRuntime(428): ... 20 more
10-08 15:27:50.956: I/Process(428): Sending signal. PID: 428 SIG: 9
before customize zoom button map run and show correctly. How can i fix this? thanks.
map.setBuiltInZoomControls(true);
Try it.