I am working on a project and it needs to accomplish the following:
A user logs into a joomla
Makes a change to some of their profile
This new information updates in the
database
Up to this point joomla will do everything, so the question is how do I take the information from the database and call it into a phonegap app. I am using phonegap and jqtouch for the app, and joomla with jomsocial for the update side.
I cannot have the app open into just a mobile version of the website because apple will reject it from the store. I need this solution to work for people to make updates to their profile, and these updates will automatically post to their app. All users input data on the same site, and share a database. Each profile however will have a different app that is released to the markets, so right now I am focusing on a template framework that can easily be changed to the users portion of the database.
From my understanding the php files stay on the server to process information. The big question is how do i call this information into a phonegap app?
To display XML as HTML you need to parse it through an XSLT stylesheet. This transforms your XML nodes into HTML. Of course, you could just use a PHP XML parser. I think there's one bundled with Joomla, but there are lots out there.
I was going to suggest using a Joomla plugin to push the data over to the Phonegap app. There are lots of events that are fired when an account is created and you could manipulate that.
If the XML is local, Jeepstone is correct. If it is not, how are you going to get it? To do this without running into cross domain issues, I suggest you try out this jQuery plugin on the phonegap side of things ... http://code.google.com/p/jquery-jsonp/ . So to take advantage of that nifty tool, you will adjust the public functions in this script to echo back json_encoded array. With which you can then do as you want on the phonegap side of things.
Ya Apple wants your app to not be useless without internet. But it is straightforward to create your index.html to show the user something. Use the failure and success functions in the jsonp library to show connection problems if necessary.
Related
I ve recently been asked to work in the front-end of a new app which will be written with Django for back end.(They said it will be for iOS).
Even though I have experience working with front-end I never wrote any code for iOS or Django REST API. What are the differences? Is it html/css ?
In another words lets assume that someone has a code in Django which asks user a question and stores the answer. The response will be in JSON(I think.) He wants me to write front end. Should I write it in html?
One more question: What will determine that our app will be working in iOS and will not work in android. They said the app will be for iOS at first but since it uses REST API what is the reason it cannot be available at the same time for android?
The usual process of using django rest framework is to have interactions with your backend exclusively using json.(most of the time, some people might use xml). So in general, all the information (requests and responses) will be JSON. Once you have that part setup, there are a number of technologies that will help you create user interfaces. You can use angularjs or JQuery to send JSON requests and responses to the endpoints and display the information obtained.(the whole interface is modified with javascript.)
Now, for your mobile apps. There are two approaches you either create what people call a native app using Java(for android apps) or Swift(for apple devices).
If you decide to use that approach you will have to mantain both apps in different languages. The other way of doing things would be to create an interface using something like angularjs and use a tool like ionic to convert that app into an android/apple app. Using that approach you will only have to mantain 1 application.
Here is a small diagram to represent the interaction.
(Django rest framework) <=JSON=> (front end app.)
I would suggest to start with django templates, it might just do the trick.
I am building an app in AIR/AS3 for iOS and Android which requires user information to be submitted and stored in a remote DB. I guess I will need to build a register/sign in screen but just wondering what the best method to store the session information in the app.
I would like it that if the user closes the app the session remains when they start it again. I currently have suspend on exit in the app.xml file. Should I just remove this?
Cheers
Probably worth giving a flip through of this for some high level ideas (without the seminar it's difficult to get details out of this)
http://www.slideshare.net/marcocasario/local-persistent-data-with-actionscript-3-and-air
If you're using Flex I'd suggest starting here:
http://help.adobe.com/en_US/flex/mobileapps/WSb0a29bf92525419c-54dd253312afbec3ecb-8000.html
Otherwise either using the File/FileStream classes and an XML file or the SQLite options are both good as well depending on what you need to save/restore and how you'll be working with the data.
Learn about sqllite, xml files, and php files. Make the flash file call a xml file that talks to a php file that talks to the mysql server.
Otherwise look here: http://active.tutsplus.com/tutorials/actionscript/create-a-flash-login-system-using-php-and-mysql-part-1/
We have a Perl application which contains a Perl/TK based GUI ( some checkboxes, entry fields, etc.)
I have been asked to modify the Perl / TK GUI part of the application so that it can be run inside a web page. Is this possible?
I found this:
http://oreilly.com/openbook/webclient/ch07.html
however it appears to create a web client and parsing the HTML response to format the output, as opposed to running inside a browser.
I would like to know if it is possible to somehow incorporate a Perl/TK GUI into web browser and if so what is the best way to do so? Maybe something like a plugin (ex. http://www.tcl.tk/software/plugin/)?
The usual way would be to rewrite your application in HTML/CSS/JavaScript. The example you show on the O'Reilly site does the opposite - it shows you how to write a Tk application that will render HTML.
A browser plugin is possible if that will provide what you need. If that is the case then the problem is trivial, but you would need the plugin installed on every PC that needs to have access to your application, and it is possible that there are certain Tk facilities that the plugin doesn't support. All you can do is try it.
There was a project for Netscape that was mentioned in Mastering Perl/Tk called PerlPlus. But it looks like the Sourceforge page hasn't been touched in a while. The intent was to run Perl (and PerlTk) code in a Netscape browser.
I'm trying to make a multiplatform offline webapp using PhoneGap. I know my html and css, but I'm not altogether familiar with the full capabilities of JavaScript, and I've never made a webapp before, let alone tried to use phonegap to empower it.
Right now, I have the main index.html that phonegap sets up for you, but now I'm uncertain as to how to proceed. If I want a button to take the user to another page from the main page, should I make a second html file and literally link between them, or is this a lot more complex than that?
Also (get ready for a possibly epically stupid question from a total beginner):
Do web apps have to be online? I'm really not clear on whether they function like normal websites in which they need to be hosted on a server, or if they can be packaged up and downloaded just like normal native apps. Please help!
Thanks.
Oh, and btw, I'm working in Xcode with the phonegap addon thing....I'm trying to get it running on the iphone before I move on to android.
Although the other answer helped me at the time, I thought I would add a more complete answer now, five years later, to my own first StackOverflow question.
To start with, a "web app" is the same as a "website" in a technical sense, and yes, they have to be hosted on a server in order to be accessed through the browser...just like every website. The only distinction is that a web app is generally a more dynamic and complex sort of website, involving JavaScript and AJAX. It would be misleading to call a simple website like this one a "web app," whereas Facebook is definitely a web app. Basically all web apps are websites, but not all websites are quite exactly web apps.
However, it only has to be "online" if you want it to be accessible anywhere from a browser via http. If you're making a Cordova app like I was at the time, that's not relevant. If you only want to run an application locally, you can do so with a local server like Python's SimpleHTTPServer or the one webpack provides, or any other alternative, including a server you write yourself from scratch.
As for the primary question about having multiple pages, yes anchor elements like my link are the standard way of connecting pages. To link among your own pages, you would have multiple .html files, and you would create a link with an href like href="myOtherPage.html", where that file is contained in the same directory as the file for the page linking to it. Alternatively you could set up a single-page-app where JavaScript loads new page content without the use of anchor elements-- in that case multiple .html files are not needed. Frameworks like Angular and React are helpful for accomplishing that, but it's by no means necessary.
In a typical web app, most of the time you would just need to create a link as you would if you were creating a link on a website. Also, Web apps can be developed via a local environment (research Mamp/ or Wamp) depending on the dependencies in which your app require.
In one of my projects, I have a very active classic ASP site with a requirement to integrate live event-based feeds as part of the existing UI. There is a plan to upgrade the site architecture to either MVC or MVP in the future, but this new feature must be implemented in the meanwhile.
I have decided to go with a WebSocket approach for this, as this is ultimately what we will want to use in the future, and rebuilding this doesn't make sense. The question is, how to integrate this with the classic ASP "architecture"?
The site already implements the jQuery library, and was hoping to leverage jQuery's capabilities to create those streamed sections on a given page.
The current req's ask for this news feed to exist on every page. Thus, loading a new page will re-render the news feed, and should kick of from where it left on the last page. For this, I'm guessing a position indicator will need to be read (session variable I'm guessing).
Anyhow, those are the requirements. I was thinking of wrapping the the entire existing classic ASP site inside a MVC or MVP (C#/.Net) project to allow us to begin swapping out legacy features as they are developed, such as this one.
I would like to get some advice on some recommended approaches for this scenario.
Thanks.
I would do a SignalR app and integrate it in you old app.
It's easy to integrate ASP classic with ASP.net MVC. Just mix the projects and exclude *.asp from the routes
routes.IgnoreRoute("{resource}.asp/{*pathInfo}");
You will have some trouble in the root (/), but you can sort it with a redirect.
For a mixed authentication (if you need it) you will need to write your own authentication in MVC to use the same auth cookie that you use in Classic ASP. I've done this in the past with success.