The best way to play swf-files (flash) in my android-program? - java

I have to play flash (swf) in my program when the user clicks on a link. Which is best? Concentrate on android 2.2 and use the Adobe Flash Player, or what do you recommend? I have tested WebView, but can not play swf in the emulator. HTC has a custom flash player but it feel like a limitation.
Some code samples to play swf in android that works for as many users as possible?

Have you considered using Flash to create an AIR app for Android rather than using Java? If you have to download and run external swf files, this seems like a path of least resistance to me. Of course, this requires learning ActionScript, but it's not difficult if you know Java.

It's hard for me to give you a solid recommendation, much like toggy-tog-togs answer. B/c we don't know exactly how many swfs or what kind of swfs you are playing.
I mean, if your application is pretty much just playing swf's and you need a UI to run it, it might be worth looking at Air and Flex.
However, to address that first problem you had. I haven't tested it myself, but I am nearly 100% certain, that your emulator won't play flash content in a webview b/c you don't have flash player installed on the emulators. :-) Android supports Flash content but only after you download and install the player from the App store.
So you might want to try running your emulator and installing the Flash player app. I don't even know if that is possible but you ought to try it out. :-)
By the way, the Android emulator is trash, if you are serious about developing for the Android platform, you really have to pick up a device or two to debug on.
Good luck!

So your using JAVA if you are then it is best to open up the browser that is the easiest but if you are wanting to use it in the application (This is less loading time if it is included in the package) but it costs try using JFlashPlayer (It Costs For the full version) http://www.jpackages.com/jflashplayer/download/ This runs very fast on the android platform. Hope I could help.

Related

How do I run an apk on J2ME?

Whats up! I just want to ask, but how do I run an .apk file j2me. I know that this question HAS been asked, but I can't seem to find an answer. Also, i'm not asking to run j2me apps on android; there are already tons of emulators. Im asking for apks running on j2me. I also know that they are developed in different VMs. So, is there any way to do that? Also, another side note, how do i resize the screen of an apk file? Thanks!
-Apersonwithalaptop22
(Edited to be easier to be understood)
You don't. A J2ME environment wouldn't have the Android framework. You'd need to write a complete android framework in the j2me language. It's not as simple as just converting dalvik bytecode to jvm bytecode- it's actually providing every single android class in the SDK. It could be done, but it would take one person a few years to do, and some things would never work quite right. Possibly you can find a project that's tried to start that effort, although I would doubt it- android moves relatively rapidly for them to keep up, and j2me is basically dead.
As for resizing the screen of an APK file- you don't. APK files don't have a screen size. Instead the idea is to write a UI that scales.

use pygtk for android apps development

I want to use pygtk app for android app development. I want to use app like pygtk which will have easy drag and drop options for developing the front end for android application.
Is there any of such thing which can let me design my front end for android app with drag and drop? (specially in python or else in java)
I see you tagged the question with kivy, I can only answer that we don't have such a thing for kivy yet, although a GSOC student got accepted for this and will start working on it soon, let's hope it'll work out nicely :). I'm of the opinion that the kvlang we have in kivy makes the need of a Graphical Designer far less than in other toolkits, but i guess YMMMV.
Other than that, I don't think you can do PyGTK development on Android currently, but I think PySide works, so maybe QtDesigner or some other Qt design application would be worth a look?

What's the right approach for creating an Android app?

I have a great idea for an Android app, but as I'm only familiar with php/js, I'm uncertain of which approach I should choose for creating it. The app will be based on a google map with a lot of position markers. There won't be any fancy animations or other heavy resource-demanding activities.
As I see it there are three different options:
Read up on Java and program the whole thing in Java
Create the map activity in Java as a mapview and then use webviews for the other activities (which can easily be scripted as html5 webpages.)
Script everything as a webapp (not really an option, as this is not a real mobile app imho.
I'm most keen on using no. 2 as I'm quite familiar with html/php/js/mysql. Have to read up on the html5 specifics, though. Questions:
I need access to GPS and camera hardware. Is that acheivable in webviews?
How complicated is it to pass variables between js in webview activities and java in other activities?
How big a difference in performance can I expect if I use option 1 vs option 2?
Other thoughts?
Kind regards,
Anders
You can choose number 2, but as we are talking about an android phone, you might want to get really accurate coordinates for your map, and you can only achieve this by accessing your phone GPS, through webviews the best you can get is the location trought the device internet IP adress, wich doesnt lead to a very accurate geo position.
The best choice is a 100% java application in my opinion.
1) Yes it's possible, but as commented it will be less accurate and probably slow.
2) Not complicated. Painful if you need loads of interaction between a webview and native app. Using a Javascript Interface that can be set up from the native app. You can basically inject javascript in a webview's html.
3) Heterogeneity of performance depending on device. Because your implementation will be based on the device's browser you can expect to get really sluggish behavior for older devices. Anything to do with HTML events (Dragging, Tabbing...) will have a knock on most devices, from my experience.
4) As #vodich comments there are other party frameworks. My benchmarking on PhoneGap and other js-based options is that they're a waste of time if you are looking at developing a professional app. I haven't developed on Adobe AIR but find a pain the need to be installing plugins to get native functionality (access to sensors, camera, etc) Mobile is all about fast, responsive behaviour. HDI is your finger, user is fast, so app needs to be fast.
EDIT: So hell yeah! Java FTW!
Albert.
4.Other toughts?
Yes, if you really want to make a great Android app, you should be using only Android and specific Android UI components, and give it a native look and feel. And regarding 1,2 yes it is possible, I would say not so complicated to just integrate them, but I think you'll eventually get in big problems.
Learn Java and write your application natively.
Webviews might allow you to use your php skills to present something to the user, but it's entirely one-way - you'll not be able to interact with what's inside.
The Android developer site offers fantastic documentation and jumping from PHP to Java isn't greatly difficult, though you'll need to get used to strict typing and "real" OOP.
Other thoughts? Don't go down the PhoneGap/Cross platform toolkit road - it might allow you to write applications for multiple platforms and using your current skills, but in the end you get a subpar app that doesn't feel right on either platform and doesn't fair well as future versions of iOS and Android are released.

Android flash vs Java

I've been thinkin about games on android and was thinking - isn't it EASIER to make a game in flash than in android using Java with android SDK ? I've only experience with Flash/AS3 and it's quite easy to create user interface, animations, layout and to write scripts.
As of Flash CS3 there are motion detection objects, so we can create really interactive games.
However I've not seen any flash game related for a phone( I mean with orientation and so ). Is there something I am missing like flash too slow on a android enabled phone?
This applies to applications too. I would like to hear opinions about Flash vs Android :)
you can create game in flash and adobe air will convert it in apk. adobeAir is version where you can create any game and just 2 or 3 step that convert it in apk.so you can publish it or play it in your android phone
Flash is not supported on Android 2.1 and lower, and some manufacturers no longer provide software updates for their older devices. I think Flash will also probably be slower (which may not be an issue if your game isn't very computation/graphics heavy) and consume more battery. It also doesn't take advantage of multi-core processors right now, but that may change in the future.
On the other hand, if you write your game in Java for Android, you will be limited to one platform.
As a compromise, you could try something like Haxe, which allows you to compile your code into flash, Java and C++, among others.

Good way to start making own Android based Media Center

i heard the rumors about google tv and stuff, but after falling in love
with android and the sdk i tought "why not to have android on my tv".
Some days ago I was looking for hardware for my mini-pc media center computer.
I think it is possible and i think is a good idea too - using android on
custom media center computer, but the question is - how? What type
of hardware i need to make it real. Connecting Htc desire HD to TV
is not the solution :-)
Your first bet it to see if there is enough driver support on http://www.android-x86.org/ to do what you need with the hardware you have. If you get the basics, video, sound, network and some form of remote control through an IR driver you'll have to figure out what features you'll want in your Media Center application.
Off the top of my head, this is what I would do:
Get Android running on my box, ensuring it can connect to my network, display to my TV and play sounds.
Determine all the codecs I want to play, and play each of the movies on the machine to verify.
Work on UPnP support to stream movies/photos/music from home computer.
Wait patiently until Flash support works on Android-x86 to play hulu
I think you get the idea. This isn't a trivial task but would be really interesting to see if you can come up with something to rivals Boxee.

Categories

Resources