-
1. Re: Build an App for Android not working.What is wrong?
moccamaximum Nov 18, 2013 2:29 AM (in response to TavaresEd)Just to be sure:
Are you aware that you have to substitute the underlined words with your credentials?
loader.content.api.play_live("HERE I ENTER MY CHANNEL NAME");
...
loader.load(new flash.net.URLRequest("http://www.justin.tv/widgets/live_api_player.swf?video_height=650&video_width=380&consumer _key=HERE_I_ENTER_MY_CONSUMER_ID"));
-
2. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 19, 2013 3:12 AM (in response to moccamaximum)Hi!
Yes,I did change them with my credentials.It is not working.The apps run and even show the texts that are on the stage but the player won't appear.
-
3. Re: Build an App for Android not working.What is wrong?
moccamaximum Nov 19, 2013 3:28 AM (in response to TavaresEd)Try to test the app first with a static video.
-
4. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 20, 2013 3:38 AM (in response to moccamaximum)Yes,I tried a code I downloaded from the net that plays a video that is also on the internet and it worked fine.
What might be the problem with my code?
-
5. Re: Build an App for Android not working.What is wrong?
moccamaximum Nov 20, 2013 4:12 AM (in response to TavaresEd)Might have sth. to do how the api handles details.
You might get more helpo on specialized forum:
-
6. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 20, 2013 4:23 AM (in response to moccamaximum)Unfortunatly there is no way to post questions anymore.
-
8. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 21, 2013 9:34 AM (in response to moccamaximum)I don't think that google group is working.Nobody answered my question yet.Do you know any other place I can get some help ?
thank you
-
9. Re: Build an App for Android not working.What is wrong?
sinious Nov 21, 2013 10:07 AM (in response to TavaresEd)What render mode are you using? You should set it to direct in your apps XML settings if you haven't:
<renderMode>direct</renderMode>
Try adding hardwareAccelerated to your <application> directive in the manifest in the same XML file (not sure what tech you're using to play the video):
e.g.
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<application android:hardwareAccelerated="true"/>
Also add in:
<containsVideo>true</containsVideo>
before the </application> closing tag. This is typically just for stored app video, worth a quick check however.
Of course give yourself permission to use the internet for the video:
<uses-permission android:name="android.permission.INTERNET"/>
See if any of that helps you. Do one thing at a time to see which works if it does so you know which are actually responsible for enabling it.
-
10. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 21, 2013 12:46 PM (in response to sinious)Hi!
I added application.android:hardwareAccelerated="true" but when I publish flash removes and when I add containsVideo I get an error application.containsVideo is an unexpected element/atrribut.
thank you what else should I try?
-
11. Re: Build an App for Android not working.What is wrong?
sinious Nov 21, 2013 12:56 PM (in response to TavaresEd)There's an issue right there, you should update to the latest version of AIR (3.9). You should also keep your Flash Player updated to 11.9 as well.
AIR SDK download:
http://www.adobe.com/devnet/air/air-sdk-download.html
Flash Player download:
http://www.adobe.com/support/flashplayer/downloads.html
After that it should not remove those entries. Make sure you target AIR for Android 3.9.
For now just updating AIR should do. If you're using CS6 or CC you should just need to unzip the folders contents (I put mine in my Flash folder) named AIR3.9 and then inside Flash go to Help->Manage AIR SDK->[ + ]->Browse to the location you unpacked your AIR files. Then Flash will allow you to target that AIR.
-
12. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 21, 2013 1:15 PM (in response to sinious)I've updated everything and I am still getting the message application.containsVideo is an unexpected element/atrribut.
-
13. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 22, 2013 8:29 AM (in response to TavaresEd)Any other Ideas?
-
14. Re: Build an App for Android not working.What is wrong?
sinious Nov 25, 2013 9:32 AM (in response to TavaresEd)The tag must be in the correct spot. For example here's an example using hardwareAccelerated and containsVideo along with internet, network state, phone state and writable storage:
<android>
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<application android:hardwareAccelerated="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
</manifest>
]]></manifestAdditions>
<containsVideo>true</containsVideo>
</android>
You probably have that tag inside the manifestAdditions which would give you that error.
-
15. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 25, 2013 4:02 PM (in response to sinious)I just did this but flash removes <application android:hardwareAccelerated="true"/> and did not work yet.It might be because inside flash's publish settings there is no option hardwareAccelerated at permissions tab.
-
16. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 8:07 AM (in response to TavaresEd)Hi!
What if I post a link to my apk file.If anyone wants to install it and see if it is working on his android I would appreciate it. A friend of ours (KGlaid)test it on his phone and said it worked there. It is not working on my note 3 Android 4.3.
http://www.djchambinho.com/ChambstationPlayer.apk
This is the code I am using:
flash.system.Security.allowDomain("*");
stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
stage.align = flash.display.StageAlign.TOP_LEFT;
var loader = new flash.display.Loader();
function loaded(e){
addChild(loader);
loader.content.api.play_live("MY Channel Name");
}
loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, loaded);
loader.load(new flash.net.URLRequest("http://www.justin.tv/widgets/live_api_player.swf?video_height=650&video_width=480&consumer _key=My Consumer Key"));
Thank you very much
-
17. Re: Build an App for Android not working.What is wrong?
sinious Nov 26, 2013 8:48 AM (in response to TavaresEd)I don't get this behavior in Flash Builder when I add that to my XML.
To be clear, an example of what <application android:hardwareAccelerated="true"/> will do is things like allow video to be played inside a StageWebView. Otherwise you won't see it (albeit it doesn't work well at all on Android).
To keep it in the mix you can always compile on the command line using ADT to avoid Flash Pro removing your XML settings. Here's some adt command line examples (this is just what Flash Pro is doing for you when you hit publish):
http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac1e63e3d128cdca935b-8000.html
-
18. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 9:50 AM (in response to sinious)There is an option inside AIR 3.9 settings on permissions tab that says that I can manually manage permitions. What do I need to do if I check that option?
-
19. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 10:06 AM (in response to TavaresEd)There is no hardwareAccelerated option in a permissions tab inside AIR settings.This might be why flash is removing this entry when I add it manually in my xml file.Is it normal not to have this entry in a settings permissions tab?
-
20. Re: Build an App for Android not working.What is wrong?
sinious Nov 26, 2013 10:44 AM (in response to TavaresEd)If others have installed your app and say they see the video just fine I don't think this particular XML attribute is your issue.
To answer you however, Flash will completely re-write your XML file every time you open the AIR publish settings. Anything it doesn't understand it has the habit of sticking strictly to the AIR XML Schema and is known to remove items it doesn't understand. This is why I use Flash Builder, it doesn't have this behavior but I must manually configure most of my XML file. In Flash Pro I used to be able to publish with extra settings after I edited the XML file using an external editor and published in flash with the shortcut (alt+shift+f12). The idea being, I know if I open the publish panel the XML will be re-written, so don't open it.
The XML file is easy enough to configure yourself and with the ADT commands above you can compile without this hassle.
-
21. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 10:52 AM (in response to sinious)Yes, it might be better do all manually.The problem is that I am new to this android developing thing and I don't know how to use ADT yet.I was looking and I didn't understand it yet.Plus I use mac I don't know how to use terminal.I guess I will have to learn these extra things first.Thank you very much for your help I will study I little bit then try to do this app.
-
22. Re: Build an App for Android not working.What is wrong?
sinious Nov 26, 2013 12:24 PM (in response to TavaresEd)You just need to get the path to the adt which is in the AIR SDK you downloaded from above. The path to adt is AIRSDK/bin/adt. Once you know that you can easily compile.
You open terminal (use spotlight to find it quick or it's just in your Applications folder). Add the full path to adt (unless you make it a global var in launchd.conf, that's another story), then the commands ADT needs to compile.
In terminal, change directory (cd) to the path you're compiling in. It should contain your application SWF, .xml, icons etc etc. I'll call it MyProject for example (which makes MyProject.swf):
cd /path/to/my/MyProject
Then run adt on it:
/Volumes/YOURVOLUME/Applications/Adobe Flash CS6/AIRSDK/bin/adt -package -target apk -storetype pkcs12 -keystore MyProjectCert.p12 MyProject.apk MyProject-app.xml MyProject.swf icons
Any extra files or folders can be named at the end of the command, like I did by including the folder 'icons'. That simple command should prompt you for your certificates password and then compile MyProject.apk in the same folder. There's your app.
Flash is just doing this for you but you can do more advanced things if you learn adt itself.
-
23. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 12:55 PM (in response to sinious)could not load keystore file(password may be incorrect) where do I set this password?
-
24. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 1:06 PM (in response to TavaresEd)I've added the password I created for my certificate and had this message anyway.
-
25. Re: Build an App for Android not working.What is wrong?
sinious Nov 26, 2013 1:07 PM (in response to TavaresEd)Did you place the .p12 cert in the same folder as everything else? It's merely telling you it cannot find your .p12 file. Make sure you set a path to it if it's not in the same folder and that you spelled the file name correctly.
Just for ease, you can type a partial filename in terminal and then hit [TAB] to have the OS complete the filename for you. If you go to type MySigningCert.p12 and type "MySi" then hit [TAB] and it doesn't complete the filename then the file is not in the same folder.
The password can be included in the command line but I kept it as easy as possible. If it finds your .p12 file successfully as soon as you hit enter to invoke the ADT command it will prompt you for your password.
password:
Make sure you type your certs password correctly as well.
-
26. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 1:11 PM (in response to sinious)yes, the p12 file is in the same folder
-
27. Re: Build an App for Android not working.What is wrong?
sinious Nov 26, 2013 1:14 PM (in response to TavaresEd)Are you getting a prompt for a password? If so you're entering the password incorrectly. If not then it's not finding a valid .p12 file.
-
28. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 1:15 PM (in response to TavaresEd)it is because my files are 2 name files like video player.fla I had to use back slash...looks like it compiled now...now it is time to test and see if it works..
thank you
-
29. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 1:21 PM (in response to TavaresEd)Yes, the compiling process worked just fine thank you but I still couldnt get my app to work.The video player is not showing..Hopefully I will get it to work.
thank you man if you have any other ideas please let me know
-
30. Re: Build an App for Android not working.What is wrong?
sinious Nov 26, 2013 1:49 PM (in response to TavaresEd)Well you've learned adt if nothing else. The rest really just comes down to the device and possibility it's Adobe has not matured enough to properly handle 4.3. I have enough issues with 4.2.x, that's about all I can think of at the moment. Perhaps a lightbulb will go off tomorrow.
-
31. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 3:22 PM (in response to sinious)thank you!
-
32. Re: Build an App for Android not working.What is wrong?
TavaresEd Nov 26, 2013 4:14 PM (in response to TavaresEd)Just one more question. When I compile my project inside flash the size of the apk file is about 10MB.When I compile it using command line the size drops to 72KB. is it right or something is wrong?
thank you
-
33. Re: Build an App for Android not working.What is wrong?
sinious Nov 27, 2013 7:36 AM (in response to TavaresEd)I'd assume inside Flash you're embedding a captive runtime. Your app gets much smaller if you exclude it and have the user install Adobe AIR for Android from Google Play. It puts a dependency on the user but as you see, your apps do get much smaller .
If you want to keep the captive runtime in there (self sufficient app) then change the -target apk to -target apk-captive-runtime.
More ADT Android-specific commands here:
http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac-4f1413de12cd45ccc23-8000.html
It's good to get used to ADT. There have been uncountable occasions I couldn't compile with Flash Pro (and even 1 time in Flash Builder) where command line compile completely fixed it. This is simply because the AIR SDK and Flash Player are updated far more frequently (which is a good thing) than the software that uses it. Using the SDK directly assures proper use of new features.




