I followed the instruction of this.But can not to make it work. Always got the "There was an error while playing" problem. Here is my steps:
Create the project in google play console
Enable the Youtube Data API for the project
Setup the credentials for the project
Import sample downloaded from google into Android studio
Change the package name to com.mydomain.youtubeapidemo
Change the developer key to the one in google play console
But I always get the "There was an error while playing" problem.
By the way, I'm using the following command to get the SHA1:
keytool -exportcert -alias androiddebugkey -keystore
~/.android/debug.keystore -list -v
What could be the reason? Thanks for any suggestion.
EDIT:
I got the following error message in my console:
04-27 23:25:28.132 4995-5050/? E/WVMExtractor﹕ Failed to open libwvm.so: dlopen failed: library "libwvm.so" not found
04-27 23:25:28.961 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Should have subtitle controller already set
04-27 23:25:28.984 4995-5058/? E/OMXNodeInstance﹕ getParameter(100663311) ERROR: 0x8000101a
\04-27 23:25:29.046 4995-5058/? E/SoftFFmpegVideo﹕ unsupported role: video_decoder.mpeg2
04-27 23:25:29.046 4995-5058/? E/OMXNodeInstance﹕ setParameter(16777239) ERROR: 0x80001001
04-27 23:25:29.046 4995-5058/? E/OMXNodeInstance﹕ getParameter(100663311) ERROR: 0x8000101a
04-27 23:25:29.046 4995-5058/? E/OMXNodeInstance﹕ getParameter(100663297) ERROR: 0x8000100e
04-27 23:25:29.046 4995-5058/? E/OMXNodeInstance﹕ OMX_GetExtensionIndex OMX.google.android.index.storeMetaDataInBuffers failed
04-27 23:25:29.161 4995-5146/? E/SoftAVC﹕ Decoder failed: -2
04-27 23:25:29.161 4995-5060/? E/ACodec﹕ [OMX.google.h264.decoder] ERROR(0x80001001)
04-27 23:25:29.161 4995-5060/? E/ACodec﹕ signalError(omxError 0x80001001, internalError -2147483648)
04-27 23:25:29.162 4995-5057/? E/MediaCodec﹕ Codec reported err 0x80001001, actionCode 0, while in state 6
04-27 23:25:29.164 4995-5056/? E/NuPlayerDecoder﹕ Failed to dequeue input buffer for OMX.google.h264.decoder (err=-38)
04-27 23:25:29.164 4995-5049/? E/NuPlayer﹕ received error(0xffffffda) from video decoder, flushing(0), now shutting down
04-27 23:25:29.164 2798-2871/com.google.android.youtube.player E/MediaPlayer﹕ error (1, -38)
04-27 23:25:29.164 4995-5056/? E/NuPlayerDecoder﹕ failed to flush OMX.google.h264.decoder (err=-38)
04-27 23:25:29.164 4995-5049/? E/NuPlayer﹕ received error(0xffffffda) from video decoder, flushing(2), now shutting down
04-27 23:25:29.164 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Error (1,-38)
04-27 23:25:29.165 2798-2815/com.google.android.youtube.player E/MediaPlayer﹕ error (1, -38)
04-27 23:25:30.415 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Should have subtitle controller already set
04-27 23:25:30.452 4995-5159/? E/OMXNodeInstance﹕ setParameter(1866465283) ERROR: 0x8000101a
04-27 23:25:30.452 4995-5157/? E/OMXNodeInstance﹕ OMX_GetExtensionIndex OMX.google.android.index.storeMetaDataInBuffers failed
04-27 23:25:30.452 4995-5157/? E/ACodec﹕ [OMX.google.h264.decoder] storeMetaDataInBuffers failed w/ err -2147483648
04-27 23:25:31.983 4996-4996/? E/local_camera﹕ We have a problem with the hw connection 2 (No such file or directory)
04-27 23:25:31.984 2798-2871/com.google.android.youtube.player E/MediaPlayer﹕ error (100, 0)
04-27 23:25:31.984 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Error (100,0)
04-27 23:25:31.987 495-554/system_process E/AudioService﹕ Media server died.
04-27 23:25:32.068 5181-5181/? E/MonoPipe﹕ Failed to fetch local time frequency when constructing a MonoPipe (res = -32). getNextWriteTimestamp calls will be non-functional
04-27 23:25:32.072 5181-5181/? E/SoundTriggerHwService﹕ couldn't load sound trigger module sound_trigger.primary (No such file or directory)
04-27 23:25:32.488 495-554/system_process E/AudioService﹕ Media server started.
04-27 23:25:33.279 5181-5194/? E/WVMExtractor﹕ Failed to open libwvm.so: dlopen failed: library "libwvm.so" not found
04-27 23:25:34.080 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Should have subtitle controller already set
04-27 23:25:34.133 5181-5200/? E/SoftFFmpegVideo﹕ unsupported role: video_decoder.mpeg2
04-27 23:25:34.133 5181-5200/? E/OMXNodeInstance﹕ setParameter(16777239) ERROR: 0x80001001
04-27 23:25:34.231 5181-5281/? E/SoftAVC﹕ Decoder failed: -2
04-27 23:25:34.231 5181-5201/? E/ACodec﹕ [OMX.google.h264.decoder] ERROR(0x80001001)
04-27 23:25:34.231 5181-5201/? E/ACodec﹕ signalError(omxError 0x80001001, internalError -2147483648)
04-27 23:25:34.231 5181-5199/? E/MediaCodec﹕ Codec reported err 0x80001001, actionCode 0, while in state 6
04-27 23:25:34.232 5181-5198/? E/NuPlayerDecoder﹕ Failed to dequeue output buffer for OMX.google.h264.decoder (err=-38)
04-27 23:25:34.233 5181-5193/? E/NuPlayer﹕ received error(0xffffffda) from video decoder, flushing(0), now shutting down
04-27 23:25:34.233 5181-5198/? E/NuPlayerDecoder﹕ failed to flush OMX.google.h264.decoder (err=-38)
04-27 23:25:34.233 2798-2814/com.google.android.youtube.player E/MediaPlayer﹕ error (1, -38)
04-27 23:25:34.233 5181-5193/? E/NuPlayer﹕ received error(0xffffffda) from video decoder, flushing(2), now shutting down
04-27 23:25:34.233 2798-2814/com.google.android.youtube.player E/MediaPlayer﹕ error (1, -38)
04-27 23:25:34.233 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Error (1,-38)
04-27 23:25:35.513 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Should have subtitle controller already set
04-27 23:25:35.520 5181-5292/? E/OMXNodeInstance﹕ OMX_GetExtensionIndex OMX.google.android.index.storeMetaDataInBuffers failed
04-27 23:25:35.520 5181-5292/? E/ACodec﹕ [OMX.google.h264.decoder] storeMetaDataInBuffers failed w/ err -2147483648
04-27 23:25:35.521 5181-5294/? E/OMXNodeInstance﹕ setParameter(1866465283) ERROR: 0x8000101a
04-27 23:25:35.525 5181-5295/? E/SoftAVC﹕ Decoder failed: -2
04-27 23:25:35.525 5181-5292/? E/ACodec﹕ [OMX.google.h264.decoder] ERROR(0x80001001)
04-27 23:25:35.525 5181-5292/? E/ACodec﹕ signalError(omxError 0x80001001, internalError -2147483648)
04-27 23:25:35.525 5181-5291/? E/MediaCodec﹕ Codec reported err 0x80001001, actionCode 0, while in state 6
04-27 23:25:35.527 5181-5290/? E/NuPlayerDecoder﹕ Failed to dequeue input buffer for OMX.google.h264.decoder (err=-38)
04-27 23:25:35.527 5181-5285/? E/NuPlayer﹕ received error(0xffffffda) from video decoder, flushing(0), now shutting down
04-27 23:25:35.527 2798-2871/com.google.android.youtube.player E/MediaPlayer﹕ error (1, -38)
04-27 23:25:35.528 5181-5290/? E/NuPlayerDecoder﹕ failed to flush OMX.google.h264.decoder (err=-38)
04-27 23:25:35.528 5181-5285/? E/NuPlayer﹕ received error(0xffffffda) from video decoder, flushing(2), now shutting down
04-27 23:25:35.528 2798-2871/com.google.android.youtube.player E/MediaPlayer﹕ error (1, -38)
04-27 23:25:35.531 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Error (1,-38)
04-27 23:25:36.694 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Should have subtitle controller already set
04-27 23:25:36.709 5181-5306/? E/OMXNodeInstance﹕ setParameter(1866465283) ERROR: 0x8000101a
04-27 23:25:36.710 5181-5307/? E/OMXNodeInstance﹕ OMX_GetExtensionIndex OMX.google.android.index.storeMetaDataInBuffers failed
04-27 23:25:36.710 5181-5307/? E/ACodec﹕ [OMX.google.h264.decoder] storeMetaDataInBuffers failed w/ err -2147483648
04-27 23:25:36.722 5181-5310/? E/SoftAVC﹕ Decoder failed: -2
04-27 23:25:36.727 5181-5307/? E/ACodec﹕ [OMX.google.h264.decoder] ERROR(0x80001001)
04-27 23:25:36.727 5181-5307/? E/ACodec﹕ signalError(omxError 0x80001001, internalError -2147483648)
04-27 23:25:36.727 5181-5304/? E/MediaCodec﹕ Codec reported err 0x80001001, actionCode 0, while in state 6
04-27 23:25:36.729 5181-5303/? E/NuPlayerDecoder﹕ Failed to dequeue input buffer for OMX.google.h264.decoder (err=-38)
04-27 23:25:36.730 5181-5299/? E/NuPlayer﹕ received error(0xffffffda) from video decoder, flushing(0), now shutting down
04-27 23:25:36.733 2798-2871/com.google.android.youtube.player E/MediaPlayer﹕ error (1, -38)
04-27 23:25:36.739 5181-5303/? E/NuPlayerDecoder﹕ failed to flush OMX.google.h264.decoder (err=-38)
04-27 23:25:36.740 5181-5299/? E/NuPlayer﹕ received error(0xffffffda) from video decoder, flushing(2), now shutting down
04-27 23:25:36.749 2798-2859/com.google.android.youtube.player E/MediaPlayer﹕ error (1, -38)
04-27 23:25:36.766 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Error (1,-38)
04-27 23:25:38.112 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Should have subtitle controller already set
04-27 23:25:38.125 5181-5320/? E/OMXNodeInstance﹕ OMX_GetExtensionIndex OMX.google.android.index.storeMetaDataInBuffers failed
04-27 23:25:38.125 5181-5320/? E/ACodec﹕ [OMX.google.h264.decoder] storeMetaDataInBuffers failed w/ err -2147483648
04-27 23:25:38.125 5181-5321/? E/OMXNodeInstance﹕ setParameter(1866465283) ERROR: 0x8000101a
04-27 23:25:38.131 5181-5324/? A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0x60 in tid 5324 (peg.aac.decoder)
04-27 23:25:38.238 85-85/? E/DEBUG﹕ AM write failure (32 / Broken pipe)
04-27 23:25:38.294 495-1532/system_process E/SharedPreferencesImpl﹕ Couldn't create directory for SharedPreferences file shared_prefs/log_files.xml
04-27 23:25:38.321 5183-5183/? E/local_camera﹕ We have a problem with the hw connection 2 (No such file or directory)
04-27 23:25:38.321 5182-5182/? E/local_camera﹕ We have a problem with the hw connection 2 (No such file or directory)
04-27 23:25:38.323 495-554/system_process E/AudioService﹕ Media server died.
04-27 23:25:38.323 2798-2814/com.google.android.youtube.player E/MediaPlayer﹕ error (100, 0)
04-27 23:25:38.323 2798-2798/com.google.android.youtube.player E/MediaPlayer﹕ Error (100,0)
04-27 23:25:38.412 5330-5330/? E/MonoPipe﹕ Failed to fetch local time frequency when constructing a MonoPipe (res = -32). getNextWriteTimestamp calls will be non-functional
04-27 23:25:38.417 5330-5330/? E/SoundTriggerHwService﹕ couldn't load sound trigger module sound_trigger.primary (No such file or directory)
04-27 23:25:38.824 495-554/system_process E/AudioService﹕ Media server started.
It works after I changed the video id in demo application. What I don't understand is it works if I put the video id from application to browser. Why the video in demo application doesn't work.
when you import the youtube android api demo ...
there you need to add your api key which one you have got from api store.
package com.examples.youtubeapidemo;
/**
* Static container class for holding a reference to your YouTube Developer Key.
*/
public class DeveloperKey {
/**
* Please replace this with a valid API key which is enabled for the
* YouTube Data API v3 service. Go to the
* Google Developers Console
* to register a new developer key.
*/
public static final String DEVELOPER_KEY = "Here you need to add your youtube api key ...dllk3m6SNbpRPHZLCly6Wq1pxM";
}
I have developed an application using Dojo 1.9.
In it I am trying to fetch data from SOAP web service using HTTP Adapter.
After Build All and Deploy when previewing the application in Worklight Console's MBS it works fine (see screen shot #1 below), same as on Android 2.2 AVD (see screen shot #2).
When running the app on an actual device it always returns "Request Failed!"
Is there any way to make it work on actual device which is connected to another network ?
Did i miss the SOAP message creation in the impl.js file?
Is that necessary to make a SOAP request call?
If yes, Will you please tell me how can i generate SOAP message?
Adapter BseNsePrice-impl.js:
function BSENSEPrice(Exchng) {
var path = 'ClientStockService.asmx/BSENSEPrice';
var input = {
method : 'get',
returnedContentType : 'text/xml; charset=utf-8',
path : path,
parameters: {'Exchng': Exchng}
};
return WL.Server.invokeHttp(input);
}
Application JavaScript:
function wlCommonInit(){
require([ "layers/core-web-layer", "layers/mobile-ui-layer" ], dojoInit);
}
function dojoInit() {
require([ "dojo/ready", "dojo/parser", "dojox/mobile", "dojo/dom", "dijit/registry", "dojox/mobile/ScrollableView", "dojox/mobile/Heading", "dojox/mobile/RoundRectList", "dojox/mobile/ListItem", "dojox/mobile/View", "dojox/mobile/Container", "dojox/mobile/ContentPane", "dojox/mobile/TabBar", "dojox/mobile/TabBarButton" ], function(ready) {
ready(function() {
});
});
}
function mobBSENSEPrice(Exchng) {
var invocationData = {
adapter : 'BSENSEPrice',
procedure : 'BSENSEPrice',
parameters : []
};
WL.Client.invokeProcedure(invocationData,{
onSuccess : mobBSENSEPriceSuccess,
onFailure : mobBSENSEPriceFailure,
});
};
function mobBSENSEPriceSuccess(result) {
var httpStatusCode = result.status;
var div = $("#invokeResult");
/*var span = $("#value");*/
if (200 == httpStatusCode) {
var invocationResult = result.invocationResult;
var isSuccessful = invocationResult.isSuccessful;
if (true == isSuccessful) {
var data = invocationResult.DataSet.diffgram.NewDataSet.Table;
for (var i=0;i<data.length;i++)
{
div.append(data[i].SYMBOL);
div.append('<br>');
div.append(data[i].PRICE);
div.append('<br>');
div.append('<strong>Change:</strong> ' + data[i].PER_CHANGE);
div.append('<br>');
div.append('<strong>Change(%) :</strong> ' + data[i].ChangePer);
div.append('<br>');
div.append('<br>');
}
}
else {
div.append("Request Failed....!");
}
}
else {
div.append("Request Failed!");
}
}
function mobBSENSEPriceFailure(result){
var div = $("#invokeResult");
div.append("Request Failed!");
}
LogCat:
07-24 11:27:08.227: I/dalvikvm(326): Could not find method org.apache.cordova.CordovaWebView.setOverScrollMode, referenced from method org.apache.cordova.DroidGap.init
07-24 11:27:08.227: W/dalvikvm(326): VFY: unable to resolve virtual method 12024: Lorg/apache/cordova/CordovaWebView;.setOverScrollMode (I)V
07-24 11:27:08.227: D/dalvikvm(326): VFY: replacing opcode 0x6e at 0x0043
07-24 11:27:08.267: I/CordovaLog(326): Changing log level to DEBUG(3)
07-24 11:27:08.277: I/CordovaLog(326): Found preference for exit-on-suspend=false
07-24 11:27:08.277: D/CordovaLog(326): Found preference for exit-on-suspend=false
07-24 11:27:08.277: D/DroidGap(326): DroidGap.onCreate()
07-24 11:27:08.317: I/dalvikvm(326): Could not find method android.webkit.WebView.<init>, referenced from method org.apache.cordova.CordovaWebView.<init>
07-24 11:27:08.317: W/dalvikvm(326): VFY: unable to resolve direct method 536: Landroid/webkit/WebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
07-24 11:27:08.317: D/dalvikvm(326): VFY: replacing opcode 0x70 at 0x0001
07-24 11:27:08.317: D/dalvikvm(326): VFY: dead code 0x0004-0046 in Lorg/apache/cordova/CordovaWebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
07-24 11:27:08.737: D/JsMessageQueue(326): Set native->JS mode to 2
07-24 11:27:08.737: I/CordovaWebView(326): Disabled addJavascriptInterface() bridge since Android version is old.
07-24 11:27:08.767: E/dalvikvm(326): Could not find class 'android.webkit.WebResourceResponse', referenced from method org.apache.cordova.CordovaWebViewClient.getWhitelistResponse
07-24 11:27:08.767: W/dalvikvm(326): VFY: unable to resolve new-instance 176 (Landroid/webkit/WebResourceResponse;) in Lorg/apache/cordova/CordovaWebViewClient;
07-24 11:27:08.767: D/dalvikvm(326): VFY: replacing opcode 0x22 at 0x000b
07-24 11:27:08.767: D/dalvikvm(326): VFY: dead code 0x000d-0014 in Lorg/apache/cordova/CordovaWebViewClient;.getWhitelistResponse ()Landroid/webkit/WebResourceResponse;
07-24 11:27:08.777: W/dalvikvm(326): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
07-24 11:27:08.777: W/dalvikvm(326): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
07-24 11:27:08.777: W/dalvikvm(326): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
07-24 11:27:08.797: D/DroidGap(326): DroidGap.init()
07-24 11:27:08.937: I/UICAndroid(326): {LoggingLevel=3, AddCookieDomain=false, PostMessageTimeout=60000, CookiePath=/, CookieParam=, KillSwitchTimeInterval=180, BufferPercent=20, HasToPersistLocalCache=true , MessageTypeHeader=WorklightHit, CookieDomain=, WhiteListParam=id, LibraryVersion=8.8.1.0, MaskIdList=com.tealeaf.sp:id/EditText*,com.tealeaf.sp:id/login.password, PostMessageLevelWiFi=3, UseRandomSample=false, KillSwitchMaxNumberOfTries=3, SensitiveCapitalCaseAlphabet=X, FilterMessageTypes=true, PostMessageTimeIntervals=30, SensitiveSmallCaseAlphabet=x, CompressPostMessage=true, PostMessageMaxBytesSize=20000, SensitiveSymbol=#, PostMessageLevelCellular=3, MessageTypes=4,5,6, PostMessageSocketTimeout=60000, CookieUrl=, UseWhiteList=true, KillSwitchUrl=, KillSwitchEnabled=false, MessageVersion=2.1.0.0, HasMasking=true, TimeIntervalBetweenSnapshots=60, PostMessageUrl=#USE_WORKLIGHT_DEFAULT#, CachedFileMaxBytesSize=512000, BufferLimit=100, AddCookiePath=false, SensitiveNumber=9, CachingLevel=3, ManualPostEnabled=true, HasCustomMask=true, DisplayLogging=true, MaxStringsLength=300, AddMessageTypeHeader=true, RandomSampleParam=, DoPostOnIntervals=false}
07-24 11:27:09.118: D/dalvikvm(326): GC_FOR_MALLOC freed 3477 objects / 255912 bytes in 101ms
07-24 11:27:09.257: I/UICAndroid(326): Screen height:420 Screen width780
07-24 11:27:09.317: D/DroidGap(326): Resuming the App
07-24 11:27:09.327: D/WLDroidGap(326): New installation/upgrade detected, copying resources and saving new checksum
07-24 11:27:09.417: I/UICAndroid(326): Network changed
07-24 11:27:09.447: D/SoftKeyboardDetect(326): Ignore this event
07-24 11:27:09.567: D/SoftKeyboardDetect(326): Ignore this event
07-24 11:27:09.698: D/WLDroidGap(326): Started copying files to local storage...
07-24 11:27:09.987: I/UICAndroid(326): Did Client State change?: true
07-24 11:27:13.757: D/dalvikvm(326): GC_FOR_MALLOC freed 3411 objects / 478752 bytes in 54ms
07-24 11:27:14.618: D/dalvikvm(326): GC_FOR_MALLOC freed 1944 objects / 461952 bytes in 52ms
07-24 11:27:17.138: D/dalvikvm(326): GC_FOR_MALLOC freed 1855 objects / 468928 bytes in 73ms
07-24 11:27:19.058: D/dalvikvm(326): GC_FOR_MALLOC freed 2204 objects / 516816 bytes in 57ms
07-24 11:27:20.668: D/dalvikvm(326): GC_FOR_MALLOC freed 2098 objects / 483856 bytes in 50ms
07-24 11:27:21.418: D/dalvikvm(326): GC_FOR_MALLOC freed 1791 objects / 472968 bytes in 56ms
07-24 11:27:22.998: D/dalvikvm(326): GC_FOR_MALLOC freed 2105 objects / 498800 bytes in 55ms
07-24 11:27:24.683: D/dalvikvm(326): GC_FOR_MALLOC freed 2203 objects / 512160 bytes in 74ms
07-24 11:27:28.677: D/WLDroidGap(326): Finished copying files to local storage...
07-24 11:27:28.709: D/WLDroidGap(326): no need to check web resource integrity
07-24 11:27:28.797: D/dalvikvm(326): GC_FOR_MALLOC freed 2474 objects / 524672 bytes in 90ms
07-24 11:27:28.877: D/CordovaWebView(326): >>> loadUrl(file:///data/data/com.Accordfintech/files/www/skinLoader.html)
07-24 11:27:28.892: D/PluginManager(326): init()
07-24 11:27:28.907: D/CordovaWebView(326): >>> loadUrlNow()
07-24 11:27:28.977: D/DroidGap(326): onMessage(onPageStarted,file:///data/data/com.Accordfintech/files/www/skinLoader.html)
07-24 11:27:30.067: D/Cordova(326): onPageFinished(file:///data/data/com.Accordfintech/files/www/skinLoader.html)
07-24 11:27:30.067: D/Cordova(326): Trying to fire onNativeReady
07-24 11:27:30.067: D/DroidGap(326): onMessage(onNativeReady,null)
07-24 11:27:30.067: D/DroidGap(326): onMessage(onPageFinished,file:///data/data/com.Accordfintech/files/www/skinLoader.html)
07-24 11:27:30.837: D/CordovaLog(326): Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only.
07-24 11:27:30.837: I/Web Console(326): Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only. at file:///data/data/com.Accordfintech/files/www/default/wlclient/js/cordova.js:908
07-24 11:27:30.937: D/CordovaNetworkManager(326): Connection Type: 3g
07-24 11:27:30.937: D/CordovaNetworkManager(326): Connection Type: 3g
07-24 11:27:30.937: D/DroidGap(326): onMessage(networkconnection,3g)
07-24 11:27:30.977: D/DroidGap(326): onMessage(spinner,stop)
07-24 11:27:31.177: D/dalvikvm(326): GC_FOR_MALLOC freed 2179 objects / 213704 bytes in 137ms
07-24 11:27:31.267: D/CordovaWebView(326): >>> loadUrl(file:///data/data/com.Accordfintech/files/www/default/Accordfintech.html)
07-24 11:27:31.267: D/PluginManager(326): init()
07-24 11:27:31.277: D/CordovaWebView(326): >>> loadUrlNow()
07-24 11:27:31.318: D/DroidGap(326): onMessage(onPageStarted,file:///data/data/com.Accordfintech/files/www/default/Accordfintech.html)
07-24 11:27:31.597: D/dalvikvm(326): GC_FOR_MALLOC freed 3136 objects / 267808 bytes in 65ms
07-24 11:27:31.817: D/dalvikvm(326): GC_FOR_MALLOC freed 1006 objects / 173440 bytes in 101ms
07-24 11:27:32.087: D/DroidGap(326): onMessage(spinner,stop)
07-24 11:27:40.138: D/Cordova(326): onPageFinished(file:///data/data/com.Accordfintech/files/www/default/Accordfintech.html)
07-24 11:27:40.148: D/Cordova(326): Trying to fire onNativeReady
07-24 11:27:40.148: D/DroidGap(326): onMessage(onNativeReady,null)
07-24 11:27:40.148: D/DroidGap(326): onMessage(onPageFinished,file:///data/data/com.Accordfintech/files/www/default/Accordfintech.html)
07-24 11:27:40.898: D/CordovaLog(326): Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only.
07-24 11:27:40.898: I/Web Console(326): Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only. at file:///data/data/com.Accordfintech/files/www/default/wlclient/js/cordova.js:908
07-24 11:27:40.958: D/CordovaNetworkManager(326): Connection Type: 3g
07-24 11:27:40.988: D/CordovaNetworkManager(326): Connection Type: 3g
07-24 11:27:40.988: D/DroidGap(326): onMessage(networkconnection,3g)
07-24 11:27:41.018: D/DroidGap(326): onMessage(spinner,stop)
07-24 11:27:41.198: I/dalvikvm(326): Could not find method java.util.Calendar.getDisplayNames, referenced from method org.apache.cordova.Globalization.getDateNames
07-24 11:27:41.198: W/dalvikvm(326): VFY: unable to resolve virtual method 10795: Ljava/util/Calendar;.getDisplayNames (IILjava/util/Locale;)Ljava/util/Map;
07-24 11:27:41.198: D/dalvikvm(326): VFY: replacing opcode 0x74 at 0x009d
07-24 11:27:41.198: I/dalvikvm(326): Could not find method java.util.Calendar.getDisplayNames, referenced from method org.apache.cordova.Globalization.getDateNames
07-24 11:27:41.198: W/dalvikvm(326): VFY: unable to resolve virtual method 10795: Ljava/util/Calendar;.getDisplayNames (IILjava/util/Locale;)Ljava/util/Map;
07-24 11:27:41.198: D/dalvikvm(326): VFY: replacing opcode 0x74 at 0x00d0
07-24 11:27:41.198: I/dalvikvm(326): Could not find method java.util.Calendar.getDisplayNames, referenced from method org.apache.cordova.Globalization.getDateNames
07-24 11:27:41.198: W/dalvikvm(326): VFY: unable to resolve virtual method 10795: Ljava/util/Calendar;.getDisplayNames (IILjava/util/Locale;)Ljava/util/Map;
07-24 11:27:41.198: D/dalvikvm(326): VFY: replacing opcode 0x74 at 0x00e3
07-24 11:27:41.198: I/dalvikvm(326): Could not find method java.util.Calendar.getDisplayNames, referenced from method org.apache.cordova.Globalization.getDateNames
07-24 11:27:41.198: W/dalvikvm(326): VFY: unable to resolve virtual method 10795: Ljava/util/Calendar;.getDisplayNames (IILjava/util/Locale;)Ljava/util/Map;
07-24 11:27:41.198: D/dalvikvm(326): VFY: replacing opcode 0x74 at 0x00f2
07-24 11:27:41.198: D/dalvikvm(326): VFY: dead code 0x00a0-00b8 in Lorg/apache/cordova/Globalization;.getDateNames (Lorg/json/JSONArray;)Lorg/json/JSONObject;
07-24 11:27:41.198: D/dalvikvm(326): VFY: dead code 0x00d3-00d4 in Lorg/apache/cordova/Globalization;.getDateNames (Lorg/json/JSONArray;)Lorg/json/JSONObject;
07-24 11:27:41.198: D/dalvikvm(326): VFY: dead code 0x00e6-00e7 in Lorg/apache/cordova/Globalization;.getDateNames (Lorg/json/JSONArray;)Lorg/json/JSONObject;
07-24 11:27:41.198: D/dalvikvm(326): VFY: dead code 0x00f5-0118 in Lorg/apache/cordova/Globalization;.getDateNames (Lorg/json/JSONArray;)Lorg/json/JSONObject;
07-24 11:27:41.388: D/Accordfintech(326): wlclient init started
07-24 11:27:41.428: D/Accordfintech(326): Read cookies: null
07-24 11:27:41.428: D/Accordfintech(326): CookieMgr read cookies: {}
07-24 11:27:41.618: D/dalvikvm(326): GC_FOR_MALLOC freed 5221 objects / 855328 bytes in 82ms
07-24 11:27:41.928: D/Accordfintech(326): before: app init onSuccess
07-24 11:27:42.018: D/Accordfintech(326): after: app init onSuccess
07-24 11:27:42.018: D/Accordfintech(326): added onPause event handler
07-24 11:27:42.028: D/Accordfintech(326): wlclient init success
07-24 11:27:59.578: D/Accordfintech(326): Request [http://10.20.50.244:10080/Accord/apps/services/api/Accordfintech/android/query]
07-24 11:28:00.369: D/dalvikvm(326): GC_FOR_MALLOC freed 7040 objects / 435712 bytes in 63ms
07-24 11:28:00.629: D/Accordfintech(326): Request [http://10.20.50.244:10080/Accord/apps/services/api/Accordfintech/android/query]
07-24 11:28:00.698: D/Accordfintech(326): Request [http://10.20.50.244:10080/Accord/apps/services/api/Accordfintech/android/query]
07-24 11:28:01.038: D/Accordfintech(326): response [http://10.20.50.244:10080/Accord/apps/services/api/Accordfintech/android/query] success: /*-secure-
07-24 11:28:01.038: D/Accordfintech(326): {"responseID":"2","statusCode":200,"errors":[],"isSuccessful":true,"statusReason":"OK","WL-Authentication-Success":{"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"wl_antiXSRFRealm":{"userId":"88cgj8s4m26caj0vstt6imlief","attributes":{},"isUserAuthenticated":1,"displayName":"88cgj8s4m26caj0vstt6imlief"},"wl_deviceNoProvisioningRealm":{"userId":"cf95dc53-f383-39a8-b6fd-749f3ef439cd","attributes":{"mobileClientData":"com.worklight.core.auth.ext.MobileClientData#59727ed4"},"isUserAuthenticated":1,"displayName":"cf95dc53-f383-39a8-b6fd-749f3ef439cd"},"wl_anonymousUserRealm":{"userId":"587f3a3b-148c-492a-9fa5-7bdbb8b9e046","attributes":{},"isUserAuthenticated":1,"displayName":"587f3a3b-148c-492a-9fa5-7bdbb8b9e046"}},"DataSet":{"schema":{"id":"NewDataSet","element":{"complexType":{"choice":{"element":{"complexType":{"sequence":{"element":[{"name":"SYMBOL","type":"xs:string","minOccurs":"0"},{"name":"PRICE","type":"xs:decimal","minOccurs":"0"},{"name":"PER_CHANGE","type":"xs:decimal","minOccurs":"0"},{"name":"ChangePer","type":"xs:decimal","minOccurs":"0"},{"name":"PREV_CLOSE","type":"xs:decimal","minOccurs":"0"},{"name":"Open","type":"xs:decimal","minOccurs":"0"},{"name":"UPD_TIME","type":"xs:string","minOccurs":"0"},{"name":"Trend","type":"xs:string","minOccurs":"0"},{"name":"high","type":"xs:double","minOccurs":"0"},{"name":"low","type":"xs:double","minOccurs":"0"}]}},"name":"Table"},"maxOccurs":"unbounded","minOccurs":"0"}},"name":"NewDataSet","IsDataSet":"true","UseCurrentLocale":"true"},"msdata":"urn:schemas-microsoft-com:xml-msdata","xs":"http:\/\/www.w3.org\/2001\/XMLSchema","xmlns":""},"xmlns":"http:\/\/ACEwebservice\/","diffgram":{"NewDataSet":{"Table":[{"id":"Table1","Open":"20200.20","PRICE":"20041.68","PREV_CLOSE":"20302.13","PER_CHANGE":"-260.45","SYMBOL":"SENSEX","ChangePer":"-1.28","high":"20252.7","low":"20018.32","rowOrder":"0","Trend":"-","UPD_TIME":"24-Jul-2013 11:25"},{"id":"Table2","Open":"6032.20","PRICE":"5974.95","PREV_CLOSE":"6077.80","PER_CHANGE":"-102.85","SYMBOL":"NIFTY","ChangePer":"-1.69","high":"6047.25","low":"5968.4","rowOrder":"1","Trend":"-","UPD_TIME":"24-Jul-2013 11:15"}],"xmlns":""},"msdata":"urn:schemas-microsoft-com:xml-msdata","diffgr":"urn:schemas-microsoft-com:xml-diffgram-v1"}},"responseHeaders":{"X-AspNet-Version":"2.0.50727","Date":"Wed, 24 Jul 2013 06:00:48 GMT","Content-Length":"2480","Expires":"-1","Content-Type":"text\/xml; charset=utf-8","Server":"Microsoft-IIS\/6.0","X-Powered-By":"ASP.NET","Cache-Control":"no-cache","Pragma":"no-cache"},"warnings":[],"totalTime":140,"responseTime":139,"info":[]}*/
07-24 11:28:01.268: D/Accordfintech(326): response [http://10.20.50.244:10080/Accord/apps/services/api/Accordfintech/android/query] success: /*-secure-
07-24 11:28:01.268: D/Accordfintech(326): {"responseID":"3","statusCode":200,"errors":[],"isSuccessful":true,"statusReason":"OK","DataSet":{"schema":{"id":"NewDataSet","element":{"complexType":{"choice":{"element":{"complexType":{"sequence":{"element":[{"name":"SYMBOL","type":"xs:string","minOccurs":"0"},{"name":"PRICE","type":"xs:decimal","minOccurs":"0"},{"name":"PER_CHANGE","type":"xs:decimal","minOccurs":"0"},{"name":"ChangePer","type":"xs:decimal","minOccurs":"0"},{"name":"PREV_CLOSE","type":"xs:decimal","minOccurs":"0"},{"name":"Open","type":"xs:decimal","minOccurs":"0"},{"name":"UPD_TIME","type":"xs:string","minOccurs":"0"},{"name":"Trend","type":"xs:string","minOccurs":"0"},{"name":"high","type":"xs:double","minOccurs":"0"},{"name":"low","type":"xs:double","minOccurs":"0"}]}},"name":"Table"},"maxOccurs":"unbounded","minOccurs":"0"}},"name":"NewDataSet","IsDataSet":"true","UseCurrentLocale":"true"},"msdata":"urn:schemas-microsoft-com:xml-msdata","xs":"http:\/\/www.w3.org\/2001\/XMLSchema","xmlns":""},"xmlns":"http:\/\/ACEwebservice\/","diffgram":{"NewDataSet":{"Table":[{"id":"Table1","Open":"20200.20","PRICE":"20041.68","PREV_CLOSE":"20302.13","PER_CHANGE":"-260.45","SYMBOL":"SENSEX","ChangePer":"-1.28","high":"20252.7","low":"20018.32","rowOrder":"0","Trend":"-","UPD_TIME":"24-Jul-2013 11:25"},{"id":"Table2","Open":"6032.20","PRICE":"5974.95","PREV_CLOSE":"6077.80","PER_CHANGE":"-102.85","SYMBOL":"NIFTY","ChangePer":"-1.69","high":"6047.25","low":"5968.4","rowOrder":"1","Trend":"-","UPD_TIME":"24-Jul-2013 11:15"}],"xmlns":""},"msdata":"urn:schemas-microsoft-com:xml-msdata","diffgr":"urn:schemas-microsoft-com:xml-diffgram-v1"}},"responseHeaders":{"X-AspNet-Version":"2.0.50727","Date":"Wed, 24 Jul 2013 06:00:48 GMT","Content-Length":"2480","Expires":"-1","Content-Type":"text\/xml; charset=utf-8","Server":"Microsoft-IIS\/6.0","X-Powered-By":"ASP.NET","Cache-Control":"no-cache","Pragma":"no-cache"},"warnings":[],"totalTime":181,"responseTime":180,"info":[]}*/
Screen shot #1 - Worklight Console MBS:
Screen shot #2 - Android 2.2. AVD:
If your application fails to connect to the Worklight server, adapter procedures will also fail. When deploying to a real device ensure you explicitly specify the Worklight server's ip address by running "build for remote server" after "build all and deploy". By default "build all and deploy" will use localhost to target the Worklight server which will result in a connection error on a real device.
To verify that your connection failure is the result of an incorrect server address use the hardware menu button to bring up the Worklight settings menu while your app is open. From there check the "change server url" box and ensure the url below targets the ip address of the Worklight server.