- This topic has 14 replies, 5 voices, and was last updated 12 years, 6 months ago by
support-michael.
-
AuthorPosts
-
YannMemberHello,
when my app is launched i send a request to remote server to verify something.
if remote server response is true i would like play a system sound like a sms or a vibration.
is it possible without phone gap?
otherwise have you an simple example of phonegap to play a sound and/ or vibrate ?
i tried to import phonegap.js and add
navigator.notification.vibrate(2000);
to my js file but nothing happen
thanks
YannFebruary 29, 2012 at 11:16 am #323821
support-michaelKeymasterHi Yann,
> i would like play a system sound like a sms or a vibration. is it possible without phone gap?
I am not aware of how a webapp can notify a user of completion of a task using sound or vibration. Your server could send your device an sms or email msg.
From a native app only (not webapp) the phonegap/cordova notification api can be used to play a beep wav file or vibrate the device. I created a simple app with a button that calls the notification.vibrate() function.
Note: Don’t include phonegap.js as there are different versions and I doubt they are compatible across versions. The appcenter builder will automatically include a phonegap.js library into the project during build time.
See attachment vibrate-ss.png
See attachment vibrate.mobiAttachments:
You must be logged in to view attached files.February 29, 2012 at 11:25 am #323822
YannMemberThanks a lot Wayne,
from js custom file i send a xmlHttpRequest to my remote server
if responseText==”true” i play a sound:o)
February 29, 2012 at 1:51 pm #323831
Albatros78ParticipantVery nice Wayne.
But I receive following error many times (MB1 1.4.2)
java.lang.RuntimeException: Failed to compile JS
at com.genuitec.mobione.codegen.processors.HTMLExporterData.exportJSString(HTMLExporterData.java:841)
at com.genuitec.mobione.codegen.HTMLExporter.generateHTML(HTMLExporter.java:715)
at com.genuitec.mobione.codegen.HTMLExporter.exportForm(HTMLExporter.java:287)
at com.genuitec.mobione.designer.export.ExportManager.exportHTML(ExportManager.java:265)
at com.genuitec.mobione.designer.export.ExportManager.exportHTML(ExportManager.java:235)
at com.genuitec.mobione.designer.action.RunEmulatorAction$2.run(RunEmulatorAction.java:48)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.lang.RuntimeException: Failed to compile JS
at com.genuitec.mobione.codegen.processors.HTMLExporterData$7$1.doOutput(HTMLExporterData.java:832)
at com.genuitec.mobione.codegen.render.TempBuffer.doOutput(TempBuffer.java:32)
at com.genuitec.mobione.codegen.processors.HTMLExporterData$7.doInput(HTMLExporterData.java:824)
at com.genuitec.mobione.codegen.render.TempBuffer.doInput(TempBuffer.java:45)
at com.genuitec.mobione.codegen.processors.HTMLExporterData.exportJSString(HTMLExporterData.java:821)
… 6 more
Caused by: java.lang.RuntimeException: Closure compiler process returned 1
at com.genuitec.mobione.codegen.processors.HTMLExporterData.runClosureCompiler(HTMLExporterData.java:891)
at com.genuitec.mobione.codegen.processors.HTMLExporterData$7$1.doOutput(HTMLExporterData.java:830)
… 10 moreAnd when the compilation works, my iphone doesn’t vibrate (3GS iOS 3.1.3) !!!
Regards
February 29, 2012 at 4:25 pm #323834
support-michaelKeymasterFor the compilation problem can you send your mobione log file? It is found at <yourhomedir>\.mobione\runtime\.metadata\.log
>my iphone doesn’t vibrate (3GS iOS 3.1.3) !!!
We have seen a few problems with phonegap running on older versions of iOS. I believe our oldest system in the lab is at 3.2.x.February 29, 2012 at 4:33 pm #323836
Albatros78Participantlog file is here
Attachments:
You must be logged in to view attached files.March 1, 2012 at 3:33 pm #323866
support-michaelKeymasterI have opened a bug for the dev team to investigate why the code-gen failures. I suspect it will be a memory problem but can’t be sure yet.
March 1, 2012 at 3:43 pm #323867
Albatros78ParticipantI have 4 Gb on my PC and probably 1Gb or 1,4 Gb of free ram when MB1 was running.
???
March 1, 2012 at 6:14 pm #323872
support-michaelKeymasterThanks for that info. I will discuss w/ the dev team. It may be more than memory since this error signature is different from classic OOM errors. Here is a question is the problem intermittent? For example if you run code-gen and it fails, can you immediately run another code-gen action with success? Or does once it fail always fail?
Do you make any changes that causes code-gen to succeed after it has failed?
Also do only certain type of apps fail such as your graphing app that uses 3rd party library or apps that you have customized the javascript? Or do all apps fail code-gen such as a simple helloworld design?
All info is helpful in tracking down these type of matters.
Thanks for your patience!!!
March 2, 2012 at 12:14 am #323873
Albatros78ParticipantHi Wayne,
Yes it was intermittent with the source code. I tried this morning and compilation works fine at each tim e!!!
I cannot reproduce it today.. (no reboot of my PC) and no change.Maybe some previous bad code always into memory before a memory refresh.
Yes I worked with JS code for my charts before (during the day)I don’t know exactly
If I have others crashes obvsiously I will send you log files.
Thanks for your help
RegardsMarch 3, 2012 at 7:00 am #323908
Albatros78ParticipantHello Wayne,
Which version of Phonegap is emulated by MB1 ? 1.4.1 ?
Need to check wich iOS version is supported for phonegap API.
with 1.4.1 seems iOS 4.0 is the minimum.Hello everybody
Does one of you has running this example on iOS 3.x ? if yes, which exact iOS version?Thanks
March 15, 2012 at 4:27 pm #324317
Max87MemberHello,
I tried this example on iPhone 4, iOS 5.01 and when I run it on Mobile Safari or add to homescreen, it doesn’t work.August 11, 2012 at 6:38 am #329083
Max87MemberHi guys,
I succesfully implemented this function to my project, but I’ve found a problem – I have set to beep every second when timer goes bellow 5sec of remaining time(in my app – game, as a notification). But it beeps even if Mute switch on iPhone is set to Mute.
Can you guys help me, how to know mute switch state?
Thanks for help.December 9, 2012 at 10:50 pm #333167
Unknown AuthorParticipantI’m also having issues with vibration. I cannot get it to vibrate more than once. My application requirement: Vibrate at a user-selected time interval until a button is pressed to stop the vibration. The iphone 4 will not vibrate more than once.
-1TCDecember 13, 2012 at 5:38 pm #333344
support-michaelKeymasterSee this example project I posted on the How-To/Examples forum that demonstrates device vibration at user defined interval (seconds).
http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=4600
-
AuthorPosts