Cordova/Phonegap - Building DataTables with WebSQL - javascript

I'm making a small application on Android/iOS in Cordova(Phonegap). The main function of the app is to maintain some local data in a database.
For this reason I've used the WebSQL, cordova has a API to use it etc..
http://docs.phonegap.com/en/1.2.0/phonegap_storage_storage.md.html
But now i want to make a CRUD table. (Create, Read, Update, Delete)
Because i'm using Cordova i cant use PHP. The only things cordova supports are Javascript CSS and HTML. (thats why the WEBSQL). I'm not gonna use a webservice to connect with an online database (app must be used offline as well, and syncing <- its a small app, don't want to make things complicated)
So my question here is: Is there a library or framework etc.. that will make "DataTables" very fast that only works with javascript/websql? I'm not gonna program it all manually if there is a solution for this.
I have checked this:
https://editor.datatables.net/examples/styling/bootstrap.html
Its perfect in all matters ! except it uses PHP...
So is there anything out there that can help me fix this fast? Thanks in advance.

I used jQuery DataTables (http://www.datatables.net) for this purpose and I can recommend you to use it too.

Related

Electron GUI with C# backend

Use case
I've got an existing project developed in C# using WinForms with custom controls for the GUI. We are amazed by the approach to write GUIs using HTML/CSS/JS and we are looking for the best way to write a GUI for our desktop application using the above mentioned languages. We only need to support Windows devices.
My worries:
It doesn't take long to come across recommendations using electron-edge. While I am not so worried to get everything working, I am worried about:
Debugging my C# code (I still want to be able to start my whole application right from VS and debug it look I am used to it). I read that I would need to attach to the node.js application in order to debug my C# code afterwards. Since the whole program language is written in C# that sounds like a pain?
As far as I got edge will let it run as just one process. Can I consider the electron application as an own thread which would still run while my C# code is stuck somewhere?
My option:
I am still positive I want to write my desktop GUI with HTML/CSS/JS. What I considered instead of using electron-edge is writing an own electron application which does communicate with my C# backend using named pipes. I wonder if there are larger roadblocks why I wouldn't want to do this and use electron-edge instead?
My question:
I would like to get feedback for my two concerns mentioned above and I also would like to get input about my option to create the GUI as own electron process, so that I have two processes (GUI+Backend) when someone runs my application.
Electron.NET may be a option for you. You can write c# code with electron.
You can do it in many ways
1) COM. Create C# COM DLL. Create wrapper functions for the DLL using N-API (Native node module) or use FFI. You can access the functions from JS.
2) Create a .Net web server and include your functions as REST endpoints. From UI make http request to communicate (Clear separation of UI & BEnd)
You can checkout my github repo for a few alternatives to electron.
I think a most import question would be how your frontend interacts with the backend? Is there any notifications need push to the frontend?
WebSocket could be a good option for two ends communication.

Is it possible to retrieve data from parse.com using objective-c and show it in website?

I have an iOS app in which I use parse.com as backend service. Now, I hired someone to do a website interface using HTML and CSS. I want to share the same data between iOS app and website, I know parse.com offers me a few ways to do this, including creating a javaScriptapplication. The problem is, my programmer doesn't have any experience in JavaScript, nor do I.
My question is: Is it possible to use what I have (objective-c, xcode) as far as retrieving data from parse.com and showing on website? Even if I need to code something new, is it possible to use objective-c together with HTML and CSS?
Thanks.
Parse has several APIs, one of which is REST. Your web developer should use the REST API to get data from Parse
https://www.parse.com/docs/rest
If there is will there is way, but you'll be making something really specific to your use and will be non standard and will be immediately hard to maintain, I recommend that you hire another developer and do things properly using the technologies given to you by parse !. if the cost will be high now I can promise you it'll be much higher if you went the path you're going to now.
So my answer is:
Yes, everything is possible and no, don't do it ! :)
Edit: Added an example to a possible way to do it to actually answer OP's question.
Example case:
1-Create a simple Mac Application in Xcode that fetches data exactly like you do it on iOS, and store the needed data into a database of your choice on your server
2-You now have access to the data you needed from parse, but on a local mirror. you will need some tool to fetch that data though, I recommend a simple PHP script.
Note that this will require an OSX server to always be running to fetch that data, you'll also need of find a way to fetch data on demand when a user needs it Vs. polling at specified intervals, this will hardly scale and will be costly as I said.

Application Craft, PhoneGap and Parse - A match made in heaven?

If I wanted to design apps that required data storage and were targeted for multiple mobile platform's, would using Application Craft to create the UI, Parse to store the data and PhoneGap to wrap it all up for the relevant target device be a potential way of approaching this?
Sorry for the generic question, black and white answers are ok in return.
What would be the biggest limitation to this approach?
To keep it simple, lets say the app is to capture images and text input from multiple users, store it and then display it in some form of activity feed.
I'm not very familiar with Application Craft, but it seems to be a paid version of PhoneGap -- meaning that they each seem to accomplish the same thing so use one or the other (unless I'm missing something...). PhoneGap can use jQueryMobile (or other frameworks) to help with the UI.
If you're going to use Parse within PhoneGap then you will need to find a PhoneGap plugin that allows Parse to work cross-platform. There likely are some, but if not you'll have to develop a separate plugin for each platform.

where to keep the database in a phonegap application

I am new to the Phone gap domain.i have done a small application in android.i just thought of implementing it in Phone Gap and see how it works?
I have used a static database in my android project.i want to use the same for the Phone Gap project?
My big Doubt is where will we keep this Database and how will we access them?
for example..in android we create a Db methods...and store what we want in an array list? and then access them when we want?
for example
instance name = db.arraylistname(id);
column name = instance name.get(0).get("column name");
other doubt is about images.what resolution images(hdpi/mdpi/ldpi/xhdpi) should we use in the www/img/ folder?
which language is better to use in Phone Gap Jquery or java script?
I have used jQuery + jQuery mobile, and they've worked charmingly. jQuery mobile even has some documentation about using phonegap, which can be found at http://view.jquerymobile.com/1.3.0/docs/faq/how-configure-phonegap-cordova.php. I've only used ajax to access external databases, so I can't personally offer any advice on local storage, but this question on SO has a marked answer so it looks like it worked for them: Best database option for PhoneGap applications?
Let me know if you have any questions or want me to clarify anything regarding jQuery Mobile.

Dilemma... Which Program & Language to develop my Android and iOS App

I'm developing an app for both the android and ios platform. I'd like to take a route that allows me to only have to code once for both platforms. There are 2 options I've come across:
Develop in Flash builder 4.5 with flex (actionscript, or I've heard javascript also?)
Develop using Phonegap (javascript)
The app is very simple - it will use the google api and the phone's geolocation function, then also display more information about the business listings from google map's api. Downloaders of the app will also have to register to become free members. All of this information will have to be put into a mysql database on my server.
So my question is, which is the best route to take with what I am hoping to accomplish? If using Flash builder, is it best to learn actionscript or javascript? What's the best way to connect with the mysql server if I'm writing in javascript, ajax?
If you are serious about it and want to create other apps as well in the future, you should learn the native frameworks/languages for each of the platforms. If not, and you just want to make one quick app I would choose Phonegap rather than Flex/Flash.
Firstly, get familiar with HTML and Javascript to understand what they are even capable of. There's no point in trying to complete a project with tools that you don't understand. As for the options you named, I'd definitely go with the Phonegap method as it is much simpler.
However, you also need a backend for your solution if you're trying to use a MySQL or other database to store any data. For this you'd need some server-side language like PHP, JSP (or you could use NodeJS, if you want Javscript on the server too) etc, that retrieves information from the database according to the requests received from your app.
In conclusion, I'd suggest you to read more about PHP/MySQL, Javascript and making webpages, since this is what you are actually trying to do if you use Phonegap, even though you might look it as an app. Do some tutorials, get to know the languages before you try to take on something that surpasses your skill level just yet.
For a nice small db-interface I'd rather suggest using ruby (with sinatra as mvc-framework and activerecord on top of mysql, or just use rails) than using php!
http://guides.rubyonrails.org
http://www.sinatrarb.com/

Categories

Resources