How to combine Flash ActionScript with PHP? - php

I am new to using flash and I need to make a web application using CodeIgniter with PHP.
I have some doubts about the MVC pattern applied in codeigniter.
I'll use ActionScript because I see that is most used and less complex. (correct me if I'm wrong)
Are my views (which are in the folder view) would separate my files in Flash?
Any IDE assist me in programming flash with php?
Should I create a separate Flash application from another application to connect php?
Any consideration to be taken into account?
Thanks in advance.

I'm not sure if "combine" is the right word here. If you integrate PHP, ActionScript and CodeIgniter, you'll actually be writing PHP within the CodeIgniter framework and then embedding Flash .swf files into your views.
If you plan on using this combination, what you'll need to do is map out your site and determine which parts are going to be done in PHP and which parts need to be done in Flash (or ActionScript).
My recommendation: Only use Flash where unescapably necessary. That is, use CodeIgniter for your website pages and to integrate with your data sources (via PHP) and create REST endpoints (via CodeIgniter) for data that needs to be accessed via your Flash implementations. Then, create your Flash (or Flex) application that needs to handle the audio recording and embed that into one of your CodeIgniter views.
Re:
I'll use ActionScript because I see that is most used and less complex (than FLEX).
IMO, Flex (and MXML) is essentially just a markup language for ActionScript. It actually gets compiled into ActionScript when you build your .swf file. So, choosing ActionScript vs. Flex is just a personal preference. If you're more familiar with the Flash interface than the Flex Builder interface, then go ahead with ActionScript exclusively. However, for what you say that you want to build (an audio recorder), there are already numerous examples of those available in Flex.
As far as an IDE discussion, for PHP - whatever you're familiar with. If you're looking for a full-featured IDE, I'd recommend something like PHPStorm. You can also get by with any text editor.
For Flex or ActionScript, you'd almost have to go with Flex Builder or Flash.

Try looking at amfphp (http://www.silexlabs.org/amfphp/) if you want to connect flash and PHP.
We used it for the commercial release of flash/flex based games with a PHP/Apache backend.

Related

Android App using HTML template with jQuery

The question is very basic, but it's very important for me. Please suggest me a solution. I have some mobile app template in HTML/ jQuery. I want to create Android app using the template. What will be the best choice for the back-end language. Database is MySQL. I have 10 years of experience in PHP. But I found PHP is used mainly for web, it is not suitable for Android app. So, please suggest what language should I learn and which IDE should I use. And finally is there anyway I can use PHP for developing Android App?
Node.js might be an alternative for the back-end, because it's still included with javascript and supports mysql
For both hybrid and native apps, you will probably need to develop an online API the app can use as a backend. That API will not run on the mobile device but on a webserver somewhere and can most definitely be built using PHP/MySQL.
For the app itself, if you want to be able to use your HTML/jQuery template, you're pretty much limited to a web app or hybrid app. These render your UI in a browser context so they're capable of loading and runnig jQuery code. You will probably have to learn about service workers to handle on-device caching so that your app stays functional when the device is offline.
For a native app, your best bet IMHO is to go with React Native. You cannot use your current HTML/jQuery template for that, since native components do not use HTML or Javascript (or CSS for that matter). But, in React Native you can rewrite the HTML part to use JSX components which are pretty similar. All the jQuery logic would have to be re-engineered "the React way" but will still be Javascript. The React Native compiler will take care of converting that JSX/CSS/Javascript code to native Android components.
It depends on you but i will suggest you if you want to expend your skills in applications development try to learn ReactNative

How to build my HTML/JS/PHP project as progressive web app in visual studio?

I do have a website, which works with the following technologies:
HTML (index.html - in combination with Bootstrap)
Javascript (some .js files)
PHP (some PHP files)
This website has more an app function. Why? Because my visitors are able to request some content from different sources, depending on their input. In addition, these different sources are hostet on different domains.
(Here an example, for better imagine about my website: Think about a website which is an online calculator. The visitor can input some data. Regarding the data there is result. What I want to do is, this website convert to an an mobile-app, better to PWA.)
What do I want to do?
I would like to build a progessive app, where I can build a mobile app which should work on iOS and Android.
What kind of tools I do have?
I do have Visual Studio Enterprise 2017. I think this IDE is enough to realize my project.
Questions:
Is it possible to use PHP on a mobile app (PWAs), which was build with Visual Studio? What do I have to take care?
If I want to create a new Project on Visual Studio, I am able to create projects in different programming language. Question, in my case, which one would you recommend me to build up PWA? Which one is most compatible to do it stuff with mobile apps? Please check my attachment.
PWA is a Progressive Web App so I think you can't use langues as C++. Maybe C# but I don't know.
Yes you can use PHP to built PWA.
Use visual studio code if you like. You decide which editor or IDE you use in your project.
Guide that can help you:
https://developers.google.com/web/fundamentals/codelabs/your-first-pwapp/

Convert webapp w/ Yii to native app - Apache Cordova & Netbeans

I have a question about web and native app development and integrating multiple frameworks.
I currently have a web app (html 5, css, js/jquery, php, mysql) and want to make available as a native app on Android and iOS. It uses Yii framework and I was thinking about using Netbeans IDE and Apache Cordova to make the conversion. How do I go about this? Can someone supply some links or an explanation to clear things up for me?
If you have a different method you'd like to recommend instead of Cordova, I'd appreciate that too. Please provide why you prefer that method though.
I've seen plenty of information on this forum and the web that explains this process, but non with Yii in mind.
Thank you for all and any help!
I had the same issue. since we have decided to drop the native app and use an html5 website design i picked, Yii+backbone.js .
in your case, if you plan on building a native app, the backend ( PHP or Yii in your case ) will not be used as a smart web server , because you will use a JS framework.
Known and well loved and used frameworks are:
angular.js
backbone.js
knockout.js
ember.js
Keep in mind, php is a server side language. Its not client based. Yii could serve as a backend providing the data thats all. When you want to use cordova you need a client side framework like jquery mobile.

Turning Web App to Mobile App... PhoneGap?

I want to delve in to mobile applications, specifically Android apps (I am an Android fanboy). My web application is a content based site; built with PHP/MySQL and served with a lot of HTML5, CSS3 and JQuery.
What would be the best starting point and direction to take to begin development of a mobile application? I've seen a couple of videos on PhoneGap and it seems very interesting with its standards-based cross-platform approach. Is that a good way to go?
My basic intend is to have an application that can load content from my site (served to the app probably as JSON or XML) which the application can render in native UI (or make use of local storage etc. that a simple web content frame won't do). I guess it would be a glorified mobile site, but I want it to me slightly more with the ability to save and render content for if internet is not available.
PhoneGap does a nice job of bridging native APIs so they are available to your JavaScript. What you really need to consider though is the look, feel, and performance of the HTML/CSS/JavaScript you run on top of PhoneGap.
I have recently started building an app with JQueryMobile. The look and feel is really nice, and I was able to build something very rapidly. However, page transitions are very blinky/choppy to the point where I don't think its acceptable. This is really a problem with Android's browser performance and not JQuery Moble.
Sencha Touch seems to have animations and transitions that are a bit smoother, but it has a steeper learning curve.
Another option is to create an application which is a hybrid, containing some PhoneGap based Activities and some purely native Activities.
Since you are already familiar with web development, I would suggest doing a quick sprint with PhoneGap and Sencha Touch. If it looks promising, stick with it. If it doesn't, abandon it for a native app.
If you want to use native UI & controls, then Phonegap will not help you. It essentially wraps HTML/CSS/JS in an app & provide JS API's for native device features. It does not help you create native UI & controls.
You can directly code in native Java or use Titanium if you want to code in JS and build portable apps with native UI.
If you are only going to be targeting Android, then I would suggest avaioding PhoneGap or other cross platform SDK's. If you're comfortable with Java or are willing to learn, go with the Android SDK tools and Eclipse.
I have found that working with JSON is extremely simple on Android, and dealing with xml is not that much harder.
If you want to stay away from coding in Java, you could simply use what you have already as an HTML5 app, and create a new mobile CSS to reflow the look and layout of your app. That way, you can still use all the HTML and javascript you are currently using, and get your info from the same server...
In my experience though, Android web app are very slow... unfortunately (and hopefully Chrome will fix this) android browser is very bad with javascript... very slow.

PHP framework that can be included in other projects

I have a little specific concern, I hope you can help me, I have to develop an application in PHP that doesn't need to be linked to the exclusive use of its installation and could be used or "included" in other projects of PHP, I mean, to develop a web application (such as generation of a graph according to certain parameters passed) that can be used on different pages created for example in phpBB, Drupal, Dreamweaver or PHP Frameworks like CodeIgniter and Zend.
The best example of what I mean is "Google Charts Tools", you just print in the browser the access to the tool with the parameters and the tool does the rest, and this does not depend on the type of framework with which the home page was created.
In short, I'm looking for a framework or lightweight framework with which I can develop an application that simply could be called in an include() or require() on the destination page and can be used, a framework that can somehow "export" the project or application and could be used on one page without having to reinstall the framework on the target server, even the libraries could be included in the target page so you can run the application.
Was working with Codeigniter and tried to attach to a Joomla page but i couldn't because Codeigniter is linked to the URL of the page and I dont want to use Iframes.
Is there something like that?
First of all; I believe you would need some custimization, as frameworks just aren't build that way. But it isn't impossible. In Kohana for example (also codeigniter, but kohana is more flexible), you can build internal requests with Request::factory($uri). If you can find out a way to bypass direct access to index.php, or build a wrapper after which you can do stuff in the Kohana 'environment' you could do it. I don't have a ready-to-use solution, but if you try something and post the code we might be able to help you out some more!
Sounds to me like you want to write a library or class that can do certain things and which can be reused in other code. You can then build an example application around it, using a framework, which uses this library.
If you start with a whole framework, this often makes it really hard to reuse any part of the code, since the framework has certain assumptions or requirements which may not always be true for other projects. As a general rule: a framework is already a complete standalone application. What you want is something smaller than that.
Of course, you can have a look at a framework like Zend, which is basically just a loose collection of individual classes. Together they form a framework, but each part of it is individually usable. Something like CI is on the other end of the spectrum, much more heavily coupled and interdependent.

Categories