We have built an electronic ticketing system using plain PHP and MySQL. After learning this system needs to be accessed on portable Android devices we hired an app developer to build us a simple app.
What is interesting is the app (from screenshots) functions almost identical to the web system we created. The app developer said after it's completed it will not rely on our system but communicate directly with the database. In the future if we update our PHP system he said we can update the app.
I'm just now learning how to develop Android apps. From what the app developer is saying it appears he's simply translating (compiling?) our code into an app. Is this possible? I'm aware there's a new method in building Android apps with PHP, but I seriously doubt he's doing that. Am I missing something, or did we just waste funds when we could have done something ourselves?
It isn't possible to run a PHP application on an Android device, no. However it could be running a lightweight browser inside an app, which accesses your website. Try making a small modification to your live site and then access the site again from your mobile device, to see if it changes.
The app developer said after it's completed it will not rely on our system but communicate directly with the database.
You don't want to communicate directly with the database - that sounds like it would require MySQL to be left open to the internet. That's not ideal from a security perspective (I don't know if Android has the drivers for it anyway). Instead, you should run an AJAX web front end and send commands (but not SQL commands) to the database that way, cleaning/untainting the input data thoroughly. Indeed, maybe that is what he is referring to?
or did we just waste funds when we could have done something ourselves?
It's difficult to answer that. If you discover something useful as a result of employing him, perhaps it was worthwhile? Of course, this illustrates that it is important to know the technical environment thoroughly when hiring someone, and perhaps when you hire someone in the future you'll discuss their technical solution prior to implementation. If you decide to pull out at that stage, pay them for the R&D and the technical spec, and do it yourself.
In any case, why wonder about it? As part of completing this item of work, ask for technical details of his implementation on both the mobile and server side. And of course don't forget to ask for the source code - hopefully it was written into the contract that you own this intellectual property.
Related
Using Laravel for PHP and DBMS. How do I make an app? (for social networking).
I have googled most of the things but I am really an Amateur and need help.
There are many kinds of apps, so before you start to work on your app, you need to carefully determine what exactly you need. You could write desktop apps for various operating systems, or native mobile apps, or hybrids, or a web application... You name it. Anyway, Laravel is the server-side and it should be as agnostic to the apps as possible. You need to create an API and handle the following things:
CRUD for the database
session (log in, log out, register, password change, user settings)
logical API functions
file transfer protocol usage
push notification (if needed)
As per your requirements, you will need to implement the server-side API in Laravel, which is a PHP-based framework and use an RDBMS, which could be MySQL, SQL Server, Oracle, or a NoSQL database, for instance MongoDB.
Before you implement any apps, you should have a proof-of-concept for the API. You should not invest too much time working out the details of the API, as when you are going to work on a real app, you will notice things to be changed anyway. The API should be accompanied by a playground for testing, maybe a very small app without design where you could send requests to the API. Or you can implement a WebSocket API to have a single, duplex connection. It is up to you.
As about how to write an API, there are many tutorials.
I want to create following project :
Server application hosted on Azure - it connects to databse via Entity framework and gives and API for anyone who want to connect (but with account stored in SQL database)
WPF application - it consumes server methods, objects etc.
Web app (php & javascript) - also consumes server methods and object etc.
IMPORTANT : I have only azure student's subscription and I want to hold onto it - buying anything else is out of the question unless it has strong argumentation.
I figured that to do this I have to create REST Web API because I have no other choice to connect to server than via HTTPWebRequest (because I want to have the same API for WPF nad web app).
My question is : does better solution exists?
I think I can create different API's for desktop client than web app but I have no idea how to do that. Whould you be so kindly to show me other way?
Why dont I want to have this solution?
Reason is simple. For big databases and slow internet connection it would take ages to download whole data in few seconds. As far as my knowledge goes there is no lazy loading in REST thus my WPF application's thread reponsible for downloading database would freeze for a big period of time.
If my question is too broad please leave a comment before you put up a flag.
Also, any tips regarding my project design are well appreciated.
Different APIs for Desktop and Web: this can be done easily enough. Assume you have a class library to contain your business logic (domain stuff). Create a web api project that makes use of it, then create yet another web api project separately that also makes use of the core models. When you deploy, deploy each separately to a different domain/subdomain (I'm unsure if you'll require further Azure resources for this, but consider api.desktop.myapp.com and api.web.myapp.com... no real technical reason why you can't do it that way, though for architecture reasons I'd avoid it (it's really coming close to if not definitely is duplication of code).
Same API for Desktop and Web: you stated that you thought you'd have to do this differently for the desktop and web, specifically because of the resource usage on the server. I disagree here, and think you should implement some standardized rate limiting into your API. Typically this is done by allowing only X amount of resources to be returned in a single call. If the initial request asks for more than X limit, an offset/nextID is returned by the API, and the client submits a new request noting that offset/nextID. This means you have subsequent calls from the client to get everything it needs, but gives your server a chance to handle it in smaller chunks (e.g., check for rate limits, throttling, load balancing, etc). See the leaky bucket algorithm for an implementation that I prefer, myself: https://en.wikipedia.org/wiki/Leaky_bucket)
I'm currently developing an iOS app and have reached the point where I need to implement a server back-end in order to support the core functionality.The app is built in a way to store certain questions locally (Within the app) and pose the questions to the app user. I need to tweak it such that it retrieves the question from a remote server. Furthermore, the question will reside in a specific folder within the remote DB. So the app will have to fetch the questions from the appropriate folder based on user login.
I have zero server experience and am need of some advise as to where I should begin with this. I would like to know if there is a template spec for this kind of task. With a template spec, I can hire a programmer and talk intelligently. Please help!
Here is a number of solutions:
1) You can use other services that provide backend functionality with REST API (as #Niklas Hein mentioned), it calls BAAS - backend as a service, such as Parse (but Parse is closing his service in one year), BaasBox, etc.
2) You can use CloudKit. This is service created by Apple, where you can store app data in the cloud, with authorization, requests, admin panel, etc.
3) Create you own back end. Here is a large number of languages and web frameworks, so php is not the only one solution. Ruby on Rails, Python Django, NodeJS, and many others on your choice.
There are plenty of BAAS (Backend as a service) provider, like Parse or Firebase. You might want to have a look into them. (Although Parse is going to shut down.)
Another simple way is to look into PHP Laravel.
Laravel is a great Framework which makes it really easy to set up a backend.
Have a look at Laracast
I need to build an iphone app that talks to a website. Logins, fetching data etc.
I have built few apps that does these using website's api but the website I'm working with now does not have one. I don't have enough knowledge of PHP or RoR so I'm not sure if I could build a back-end API from scratch and then start on the ios development.
I did some research and it looked like there are websites like parse.com or appactive where they help you with back-end api. Though, I looked around the website and read the about page but I'm still not sure how they work. Could those services help me if I already have a server/website running and I need an app that requires login and data exchanges?
Jus a note, in 2016 Parse has closed (it's now open source and you run it on Heroku or whatever). There are many other "baas" such as Firebase etc.
Since there seems to be some confusion,
(a) your current service has no API. it is, thus, unfortunately essentially useless so your most absolutely time saving step from here would be just scrap it and use parse (or another baas) as the backend. you can have parse up and running in minutes. what previously took server developers man-years is now just like "a consumer product", just make a few clicks to add column-names
(b) your current service has no API. assuming yo DO WANT TO continue to use it, you will have to somehow add an API, using php or whatever. there's no way to avoid this. IF you do that, then you could (if you wanted) make a "basic" API that parse can get the info from, and then use parse to actually connect to the ios/android builds (since that is so easy)
TBC, here's literally how you do that in Parse,
https://parse.com/docs/cloud_code_guide#networking
"Cloud Code allows sending HTTP requests to any HTTP Server" it's that simple.
As I mention above, it's far easier just to scratch your current backend and change to a bAAs (such as Parse). you have to "go with the times" you know?
Note that the development and testing of an API on a service is incedibly time consuming, it is a huge job for a team.
Here on this question you seem to be asking about bAAs and how they fit in the formula. the answers are:
(1) if you simply scrap your current service, do everything on a baas: it is trivial. what used to take literally man-years is now a few clicks
(2) in terms of "helping you ADD AN API to that service". bAAs cannot help you with that in any way and is irrelevant
(3) if you DO have a service with an API, yes it is relatively easy to have bAAs "link in" to that. (i include literally the doco from pare on doing that above)
Hope it helps!!!
I have one .php web site and I want to put it in iPad application "web application".
I mean create UIWebView and load files in WebView, so my First question is, is it possible to create this webApp and can I run it on Xcode simulator?
What do I need for implementing this application (Apache, MySQL) inside ipad outside?
Basically I want to have all my .php class inside of app and run it via iPad app, it means that if I hadn't any internet I can run the application.
Since I want to run it in both iPad and XCode simulator.
Would you please give me some hints for implement this application?
A few points you need to think about:
App Store Approval - if you intend to market this app (i.e it's not for jailbroken devices via Cydia, or an in-house corporate app) then you will most likely run in to issues with the approval process.*
You're intending to bundle in a scripting language with your application. Now this may not be an issue depending on whether or not this is exposed to the end-user; but you do run the risk of Apple finding out and pulling the plug.
The alternative to bundling in a scripting language (PHP in your case) is going to be loading the code off of an external server. This is a no-no straight away, as Apple requires your application to have functionality offline - or atleast they did. Where this leaves all the Social Networking and other network-dependant apps... Well, I guess there are exceptions!
Device Performance - you're essentially intending to run a small web server on a mobile device; a tablet in this case. This could be very resource intensive, so is probably not wise. I personally wouldn't want my battery being drained because someone has decided that they want to bundle in a web server with their application.
Your implementation idea itself is sound, in the respect of using a UIWebView. You should probably check out the Apache Cordova/PhoneGap framework, and that should satisfy your needs and provide an off-the-shelf way of packaging up your web app. If you do need custom functionality then it's worth looking at anyway; plugins are relatively easy to develop, there's a wide range available already and the plans for cordova now are to allow developers to implement it into native applications. (Say, if only one view requires PhoneGap functionality etc)
Personally, I fail to see what requires PHP that can not be done via HTML5 and PhoneGap. There are storage options available, SQL options, you're using web technologies so can easily query external web services. It's also a lot safer with regards to app approval - as it's tried and tested; there are many applications build using such solutions already in the store.
I think you need a serious re-think. Otherwise, perhaps you could post some more details?
Please note that PHP is a server-side language. So do you want to run a server on your iPad? If so, you can develop PHP applications on a proper desktop/laptop and then view them on iPad Safari browser over Wifi.
Otherwise you can install LightHTTPd server with PHP libraries, MySQL, CURL and all from Cydia app store on a jailbroken iOS device to get a full environment. For Android there is this app PAW server available which can run an Apache server in such devices.
If you just want to check your website is working fine on small devices, or you want to check responsiveness of your website. Go to:Ipad Peek and run your website on given devices/simulators using url.
A simple google search pulled up this free framework: http://www.ipfaces.org/
I've never used to before, but it might do what you need.