Copy link to clipboard
Copied
I can not get any example I find to work.
Often I see that I have to add this to the application discriptor xml:
<extensions>
<extensionID>com.example.Extension1</extensionID>
<extensionID>com.example.Extension2</extensionID>
</extensions>
But when I do that, I get a parsing error. I've tried putting it in various place. Why don't the instructions ever say where this node belongs?
Does anyone know of a detailed step by step instructions for setting up an app that vibrates? I teach and many of my students what use their devices vibrate abilities. They are so frustrated that they want to ditch Flash. I think I've got their projects working as far as including swc and ane files, I don't get errors. But the vibrate just wont work and I don't know where I put this node.
Please, Adobe, write detailed instructions for this. It's a common desire amount developers. I apperciate the ane approach, it's great, but you need to explain at a level anyone can understand and with no assumptions. Please display an example of this node being used.
Thanks!
Copy link to clipboard
Copied
Why don't the instructions ever say where this node belongs?
It must be placed inside <application></application> node.
You can find any open-source air application with ane and see how it works inside. For example - https://github.com/illuzor/Simple-Android-Game/blob/master/application.xml
Copy link to clipboard
Copied
Thanks for replying. When I put the <extensions> node into the <application> node I get a parse error. I'm using Flash Pro CC and trying to publish a iOS AIR app. For the record, I prefer Android, but a lot of people use iOS. Are there any iOS examples of using vibrate?
I teach college students, and the frustration they are having with ane files (extensions) is making them regret using Flash to develop for mobile. I understand and appreciate Adobe's approach, but they need to write a very detailed step by step tutorial on how to use ane files in a project, for both Flash Pro and Flash Builder. Otherwise they are going to lose a lot of casual developers, I have lost a few students to other cross development tools.
Copy link to clipboard
Copied
Maybe this can help?
http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt1.html
http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt2.html
http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt3.html
http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt4.html
http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt5.html
Copy link to clipboard
Copied
Thanks for those. Those are good, but a little too advanced and doesn't cover enough about how to set up a Flash Builder or Flash Pro project to use the extension.
What my students need:
How to set up their project, do they need a swc? do they need an ane file? How do they include the ane file in the project.
Then instructions on using AS3 and the extension.
Then how to set up the application xml for Android and iOS.
And anything else…
I’ve found some of these answers, but all in different articles, I can’t find one article that does a detailed step by step.
I teach grad students that are about to present their thesis, so each students needs are different, not all need extensions, but many do. So I do have time to sit down and experiment using many different extensions with them.
I had a student struggle with using native maps in her Flash app, she switched to a competitor and it's working. She is not an advanced programmer, not even close, and my students have taken notice of how easy it was compared to Flash. I know Flash can do it, it's just not documented well for the casual developer. My students are New Media students, they want to casually develop. And Flash has traditionally been a great tool for the casual developer and the advanced, but lately it has been abandoning the casual developers. I feel that this can be solved with very clear instructions with the casual developer in mind. A casual developer is not going to create their own extension, they just want to use ones that are already available.
I have a student who has been trying to get her app to vibrate on the iPhone, she has spent around 10+ hours, she still can't get it to work. All I can do is give her articles I find and try to "translate" them for her. But I have other students too. She presents her thesis today and she had to give up having her app vibrate. She is not feeling very confident with using Flash in the future.
Copy link to clipboard
Copied
Those links I posted are for more creating the ANE, not necessarily just a quick how to use. I think it just may be a matter of finding the right tutorial, I don't know where or if 1 that suits your needs exists, but from my experience the best tutorial is a working example.
Maybe try this? http://distriqt.com/native-extensions#vibration
I've never used this ANE but have used other's and never had any problems.
Copy link to clipboard
Copied
Hi,
Thanks for sharing that. I've seen it before tho. I'm crossing my fingers that someone shares, or creates, a step by step tutorial on how to include an ane file in a Flash Builder or Flash Pro project. The sample I've found only offer the code and resources, not how to set up the project (ie: is there a swc? how to set up Flash and Flash Builder to use the ane file, etc.).
Cheers.
Copy link to clipboard
Copied
Every native extension i've used had both an (ane) and (swc). These are the only things you need to use the ANE.
I'll try a quick run down for how to use that distriqt ANE in Flash Builder... (though the same process applies for every ANE i've used from other places too). Never tried it in Flash alone. Though if you have Flash Builder, I def recommend using it.
1 - Setup a normal mobile project (can't help you if you're stuck here)
2 - In the root of my project, I place the (swc) inside my "libs" folder and place the (ane) inside a new "ane" folder i create.
3 - I believe sometimes Flash Builder 4.7 even does this for you, but make sure in your -app.xml, inside the main <application></application>, you include the correct extension ID
<extensions>
<extensionID>com.distriqt.Vibration</extensionID>
</extensions>
4 - Also include the manifest additions for Android
<android>
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
</manifest>
]]></manifestAdditions>
</android>
5 - Right click your project in the Packager Explorer > Properties > Actionscript Build Path (or Flex Build Path) > Add your "ane" folder you created.
6 - In you application, use the ANE with actionscript.
Vibration.init( DEV_KEY );
Vibration.service.vibrate( 1000 );
7 - Make sure the ANE is being used correctly. right click the project > Properties > Actionscript Build Packaging (or Flex Build Packagin) > iOS/Android> Native Extensions Tab > And verify the ANE is listed and being used. You'll see a little green check if it's being used.
8. Though i've never done it, I believe for iOS some ANE need to also include the Apple iOS SDk. Make sure to include it in the same location as step 7.
Copy link to clipboard
Copied
This is very helpful.
How would using this extension for iOS differ from using distriqt's?
Thanks!
Copy link to clipboard
Copied
... not really sure I follow you. I provided an example of how to use the ANE from distriqt for both Android and iOS.
The same steps apply for other ANEs too. For example, here are some free ones: http://extensionsforair.com/ and I'm sure other websites are offering more
Also this is very informative: http://tv.adobe.com/watch/max-2011-develop/how-to-extend-your-mobile-air-applications-using-native-e...
Copy link to clipboard
Copied
oops, sorry, I meant to inlcude this link:
http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/vibration.html
But when ever we've added the <extensions> node we get a parse error. I'm very familar with XML and the nodes all look formated right, but it never works for us. We are using Flash Builder to code, but Flash Pro to test the build on a phone. And Flash Pro gives a parse error when we add the <extensions> node.
Copy link to clipboard
Copied
Can you share your full sources?
Copy link to clipboard
Copied
It's not my source, I don't have it. I'm helping a student. : )
Copy link to clipboard
Copied
Hi illuzor,
I tried to use Flash Pro CC to build a test app for Android using the vibrator. But I can not get it to work.
I'm following this example: http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/vibration.html
Here is my test project: http://www.dayvid.com/professor/vibrations.zip
If you can please take a look at tell me what I'm doing wrong, that would be great!
Thanks!
Copy link to clipboard
Copied
Nevermind. I got it to work. I was trying to load a "ane" folder in the library path. Now the FLA is loading in the ane file directly in the library path and it works. would be nice to be able to load in a folder, like with SWCs : P
Copy link to clipboard
Copied
Well from what I can tell that is basically the same thing. Theres an ANE and a SWC. Just seems like the extension ID is different as well as a slightly different way to use it in Actionscript.
I 100% recommend trying to use the ANE with Flash Builder. If you're already coding in Flash Builder, why not just compile there too? IMO debugging in Flash Builder is way better than debugging in Flash Pro.
I don't get the parse errors you mention when I using Flash Builder 4.7 with AIR 3.9. BTW... what is your parse error?
Also, What version of Flash Pro are you using?
Copy link to clipboard
Copied
Thanks for the advice.
The computers at the college don't always have the correct set up allowing for debugging with Flash Builder. So we develop in Flash Builder then debug in Flash Pro. Also, Flash Pro has the simulator, and also will directly install on a mobile device.
Remember, these are design students that are casual developers. They don't have time to set up Flash Builder for testing with the iOS Development tools. Flash Pro simulator works pretty good. So is it not possible to use ANE with Flash Pro? Will the students always get the parsing error?
We are using Flash Pro CC and Flash Builder 4.7.
Copy link to clipboard
Copied
Flash Builder has the simulator and can also install directly on a mobile device. no difference to Flash Pro.
I don't really know what else to tell you. Every option I've given, you've had a response of "you won't", instead of "you can't".
I can think of no reason as to why debugging would be allowed in Flash Pro, but not Flash Builder (as it works out of the box).
I would argue anyone trying to use an ANE (casual or advanced), should at least have the pre-requisite to understand how to setup a Flash Builder Project and deploy to a device from it.... it should take minutes.
I never once said it is not possible to use an ANE with Flash Pro. I simply stated that I haven't. It should 100% work with Flash Pro. Maybe try re-installing Flash Pro, or using a different computer.
Copy link to clipboard
Copied
Sorry if I've frustrated you. Flash Builder wont debug without the Flash Debugger installed. So unfortunately it wont debug out of the box. All of the computers at the university are locked up, no admin rights. I beg and beg to have them install the flash player debugger, sometimes they do, sometimes they don't. So Flash builder at the university wont debug. that's why we debug using Flash Pro.
Can you share a tutorial on how to use the simulator with Flash Builder? I've never seen nor heard of this before. I now how to set up Flash builder to work with Apple's dev sdk. But I've never seen a simulator in Flash builder. Where is it? Thanks.
The parse error doesn't say much, just parse error. It only occurs in Flash Pro and during publishing.
I don’t feel I’m saying I won’t, I’m saying I can’t, I can’t get vibrate to work using Flash Pro CC. I know Flash Builder is a far better solution, it’s unfortunately not a solution for this situation. FYI - I’ve been developing with Flash for 15+ years, and using Flex/Flash builder for at least 5.
Thanks.
Copy link to clipboard
Copied
sorry, also, this happens on many computers. We have many computers in the class rooms.
And sorry, but I didn't mean that Flash Builder doesn't install directly on a device, I just said that Flash Pro does that as well as debug. (remember, Flash Builder wont debug on the university’s computers, well most of them). I teach at a large university and teach for two schools within the university. Flash builder wont debug on windows or mac.s Because of the Flash Debugger not being installed. Trust me, I am very frustrated with this, and have bugged support (no pun intended) for over a year.
cheers.
Copy link to clipboard
Copied
Only frustrated with being unhelpful.
Flash Builder should 100% definitely debug your AIR app without the Flash debugger installed. The flash debugger (Flash Debug "Player") is meant for the debugging on the web (browser uses the player). I've been using Flash Builder for a few years now and I've never had to install the flash debug player for testing AIR apps. (I even just installed a fresh Flash Builder on a new laptop and it debugs like a charm)
I misinterpreted what you meant by simulator, as I was refering to Flash Builder's ability to run the AIR simulator as a Launch method. You are correct in that Flash Builder does not have the simulator for testing accelerometer or touch gestures.
In saying "I won't" i was referring to what seemed to be a push against ramping people up to using Flash Builder. It has tons of benefits > Code editing features, quick assist code generation, memory and performance profilers, and network monitoring.
Copy link to clipboard
Copied
Hi,
Yes, the debugger is not needed for AIR apps. But my students start their projects out as just Flash Player projects. They are students, they are learning, and some are new to programming, so that's where they start. They aren't always testing their mobile apps as air apps, for many reasons. Also, not every class room has Flash builder. And Flash builder is more difficult for the university to update. And Flash builder sometimes wont open due to the work bench issue. Which I can fix, but the students get confused. Also, I'm the only instructor in the university that uses Flash Builder, so whent the students go to labs or tutors for help, no one can help them.
Now remember, I use Flash Builder, but since teaching, I've discovered that Flash Builder is more difficult to maintain than Flash Pro. It's not an issue for me and my personal computers, but issues arise for the schools technical support team. So everything I develop for the students, and everything I teach, has to also work in Flash Pro, even though I'm creating it in Flash Builder. It's a fall back issue. So again, I use Flash builder, I prefer Flash Builder, and when I can, I teach Flash Builder, but at the school it is not always an option.
So does anyone know if extensions will work in Flash Pro CC?
Copy link to clipboard
Copied
We fixed the parse warning. the <extensionID> we had found from a tutorial was wrong. It was the path of the Vibration class including an extra package. We found the corect one: com.adobe.Vibration.
I still believe that this needs better documentation, or tutorial. It did make sense to me to include the eniter package path so I didn't question it. Downloading the examples from here: http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/vibration.html
includes the AS3 files, so that's what I was looking at and trying to use. We are now only using the swc and ANE file. Unfortunetly the student had issues installing the app on her iPhone so we couldn't test it. I know it will eventually work, but I still feel strongly that this is not well documented.
I did however find some helpful links:
http://www.adobe.com/devnet/air/articles/using-ane-in-flash.html
I've heard a lot of good things about Flash Develop, but one department I teach for is all Mac and last time I checked, Flash Develop didn't have a mac version.
Cheers.
Copy link to clipboard
Copied
not trying to beat a dead horse.... but another great reason to use Flash Builder, is that when you add your ANE to the project, it will auto add the correct extensionID
Copy link to clipboard
Copied
there are lots of great reasons to use Flash Builder, that's why I use it. But like I said, it's not always an option. Cheers.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now