Copy link to clipboard
Copied
Is there a way to use the vibrator on android devices in Adobe Air ?
Thank you
Copy link to clipboard
Copied
I ran into this exact same issue tonight, and wasn't sure if the VIBRATE permission was available, since it isn't visible in the "AIR Android Settings" menu when publishing from Flash Professional CS5. Here's what I did to see if I could add it manually (not sure what method you're using to create your APK files, but this is how I've been doing it):
I published my app using the AIR Android Settings menu from Flash. Make sure at least one permission is selected (such as INTERNET or WAKE_LOCK). It creates the APK file along with an XML file (appname-app.xml). Go into the XML file and find the section similar to this:
<manifestAdditions>
<![CDATA[<manifest>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/> // here is the line that you need to add
</manifest>]]>
</manifestAdditions>
Once you add that line, VIBRATE should appear in your permissions menu now. Publish an app as you normally would, and when you install it on your Droid it should ask you to verify that you'll be using this permission. Voila!
Copy link to clipboard
Copied
Thank you, but I don't find the as3 code to make a vibration. Have you a sample ?
Copy link to clipboard
Copied
Although you can add that attribute to the manifest file, currently there is no method to trigger the vibration on the device. If this is an important feature, please go to https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform and let your request be known!
Chris Griffith
Adobe Community Professional
Copy link to clipboard
Copied
Thanks for the clarification, Chris. I didn't take into account the fact that even though you can get permission for it, there might not actually be a function to do so. There are actually a few things that Adobe AIR doesn't seem to support quite yet, but hopefully this will be changed soon enough!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now