how do i implement a google doc-like app on mobile? - javascript

I'm currently working on a project similar to google docs. Basically, it allows
multiple users to edit word documents concurently in a web browser. I've been
working extensively in pure javascript nodejs and socket.io. The web based
text editor was written from scratch using HTML5, CSS and Javascript. I handled
Operational Transformation(OT) with shareJS(server & client library that allows
realtime editing).
The challenge I'm having now is with mobile development, where I typically want
to develop for both android and iOS. I've been unsure about the right workflow and
technical decisions to make. Below is what has been going through my mind:
How do I incorporate my javascript application into a native iOS/Android app? Should
I just build an exact clone of what I have on the web from scratch? I mean build a
replica of my web implementation in iOS(Swift)/Android(Java). Of course this would mean
re-writing my text editor and OT scripts from scratch in the native language. Does that
make sense?
I know of NativeScript and phonegap. But then, when it comes to mobile, I prefer leaning
towards the native language. Is there a way to wrap my javascript into Swift/Android in
order to call my javascript functions?
Have been thinkin about this for weeks now, pondering over how to go about this. I think i need suggestions,
thoughts and advice from other frames of reference. Thanks in advance

Related

How to provide JavaScript library for mobile native apps?

I am not a mobile developer, hence please excuse me for incorrect assumptions, if any
I have a library which users want to integrate in their native mobile apps. It is written in JavaScript, but I don't want to rewrite for Android and iOS. Hence what I need is some way that this JavaScript library can be used in native apps. Following two ways look promising:
WebViews: The JS files would reside locally and webview will be used to run them
NativeScript: NativeScript allows you to create native apps from JavaScript. But I didn't find anything which suggests that I can create native library too. Can this be used in any way?
You might be looking for React Native
It is a Javascript framework, and when you write your code, most of the time, you can use the same code for iOS and Android. It is a relatively new framework, but can be very powerful for rapid cross-development, but (obviously) has its trade-offs.

Automated testing of webpage

I've recently started designing websites for fun and I just started learning Javascript and HTML. I'm wondering if there's a way that I can setup some kind of script to run to simulate users using the website, i.e. clicking specific buttons. Any sort of lead would be helpful,
Thanks!
Selenium (http://www.seleniumhq.org/) is an excellent resource for browser automation. It supports multiple languages and platforms so you can code it in a language that you're comfortable with.

Integrate one visualisation from d3.js in an android application

I want to develop an android application which is to integrate a visualization from d3.js. Is it possible? Can anyone explain how to do this.
D3 is a library geared towards manipulating data and rendering it into an html DOM –– either via SVG, or straight up divs or perhaps a canvas. Of course there also needs to be a JavaScript engine that can run the code. Browsers provide all those things; native apps provide none of them out of the box.
However, there are ways to build native apps that wrap a javascript engine and DOM. PhoneGap is a commonly used framework for doing so. It essentially lets you develop as if things are going to run in a browser, but they're packaged into a native app. There's a performance hit to that: It won't run as fast as a native app, and often not even as fast as the same code would run in a mobile browser. But from the user's perspective, it's installed and launched just like any native app.
That's AFAIK the only way to use d3 in a native app.

convert phonegap into steroids

I'm currently looking into the options of cross platform app development, and since we already have a working (but slow) Phonegap app we consider turning it into a steroids app. So I want to know if you can convert it without rewriting all the code. And if the speed of the steroids app will be comparable with Titanium or Xamarin, which is our goal.
I haven't used Titanium or Xamarin, but I have used Steroids.js and have absolutely loved it. From going to a vanilla PhoneGap app with jQuery Mobile to Steroids the change has been very noticeable. The different native UI elements they open up make it feel much less like a web app and more of a true hybrid app.
You wouldn't need to rewrite your code, but if you wanted to take advantage of the different features that make Steroids great then you would need to rewrite some parts. You can use the PhoneGap to Steroids guide to help you create a Steroids project with your existing code.

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