Wondering about capabilities of titanium appcelerator? - java

We have a web application that uses (java/Java EE, Struts, Hibernate) running on Apache tomcat using MySQL as the DB. It has been up and running for quite a few years, so we have a very large pool of data (millions of row).
We need to convert this web app to a mobile application (cross platform, ios, Android), so we've decided to use the Titanium Appcelerator.
I have quite a few concerns before implementation:
I've heard that titanium gives you very good gui, but what about the functionality? What happens when a user clicks a buttons (sending/retrieving data from db)?
Can I use java to handle this??
I have seen examples of interacting through database, but approx all are using PHP as as a server side language, but nobody knows PHP here.
Though our team has some android exp(all sort of JSON, small client app), I am not sure whether it would be helpful.
Out goal is to convert a huge CRUD web app to a cross platform mobile app (I dont want to lose java on the server). Can Titanium appcelerator handle this?

See the App as something separate. It doesn't matter what is on the other end, as long as you get either JSON or XML (or something else if you prefer).
Titanium Appcelerator is a JavaScript tool that can handle (both build-in) JSON and XML.
To answer your questions:
1: Functionality is really good. It cannot be done by Java, but you'll get events (in JavaScript) which handles click/swipe/press/doubleclick etc. Events are always defined in the Documentation. In your case, the button. You can see what events it can handle there, and what properties you can set.
An example from the docs page adding a button, and having the click event.
var button = Titanium.UI.createButton({
title: 'Hello',
top: 10,
width: 100,
height: 50
});
button.addEventListener('click',function(e)
{
Titanium.API.info("You clicked the button");
});
2: Whatever server side language you use, as long as you export usable content (JSON/XML) it is useable by Titanium. It acts like a client. No need to worry there.
3: as answered above, you can do everything with it you want. On server side you only need to write an API which can handle everything.
I hope this will take away your concerns. If you need more help on other questions, just enter a new question on SO and I'll see them pass by.

As already stated by Topener, Titanium is able to handle your requirements. I'd like to point out something more fundamental:
We need to convert this web app to a mobile application (..), so we've decided to use the Titanium Appcelerator.
I'm somewhat surprised by this reasoning, kinda "We needed a car, so we decided to buy a Nissan." Why not a Ford, a Holden or a Porsche?
There are in fact well over 30 technologies claiming to be able to do cross-platform mobile development. I took a deep look at 16 of them during the course of last year for my master's thesis.
I'd suggest you have a look two other technologies as well. Why? You are converting a web app to a mobile app. Why not consider a framework that allows you to write your app's UI using web technologies? You might be able to port some of the existing UI-code, after all.
PhoneGap (free, now owned by Adobe): You implement the entire app in JavaScript, basically as a WebApp, but you get a native, installable binary that can be distributed using the AppStores. Easy to combine with a SenchaTouch HTML5-UI.
Rhodes (free, now owned by Motorola Systems): You implement the UI in HTML5 and the logic in Ruby. Rhodes provides a really good Object-Mapper and Sync capabilities. As you seem to have quite a bit of data to handle, this could provide a significant advantage over Titanium's SQLite Database. Learning the bits of ruby should not cost you more than a week or so.
If you definitely need a native UI, then the AQUA-Framework might be worth a look... but I havn't tested that one.

Related

Java Desktop app with webview UI

I want some way of creating a dedicated browser window for a browser (chrom-e/ium or firefox). Its content needs to be controlled by a java application (a http call to localhost or better a more direct way of communicating). These two should be bundled together in some way.
A little Background
I want to write a java desktop app but don't want to use Swing or javaFX for the UI. The UI should be written like a one page app and may be ported (at least partially) to the web. I have taken a look at the javafx WebView but would rather have a full fledged browser on my hands. It would also be nice to have a little more control over said browser to send files and read files in a more desktopish way. The only real requirement is that there has to be some java backend behind it and that is has to work offline.
Is something like this possible at all or is it just a pipe dream?
I am very almost a year late for the party, but:
There are a few (that I know) technologies that can help you:
Electron. It is basically what you want, you can use web
technologies to "forge" a desktop app, it's quite well known, I never used it but for what I have read that you can stick almost anything to it's "backend".
JavaFxWebView. There are some really nice ways to use it, you can
even use bootstrap and AngularJs, here is a example (not by me)
Yes it's possible and not all that unusual. Your app can open a default browser as described here -
https://stackoverflow.com/a/10967469/5087125
And then proceed to respond to http requests to your app.

How to input data programatically into a system that puts up a form but doesnt have data upload features

I'm not sure if this question is entirely appropriate for SO but it seemed to work better here than in SuperUser so apologies if its in the wrong place. Happy to move it if so.
I'm trying to figure out how I'd automate the input of data into a system that didn't accept data uploads, but rather used forms put up on a screen. Use cases are e.g. where an enterprise wide system does accept uploads but the user lacks admin rights to fill in data she is required to populate, or with very old and specialized legacy systems where the functionality just doesn't exist and a serial input-review-rollback-commit cycle is enforced.
I'm not a programmer by trade so this is partly thought experiment but also to answer a question that has arisen at a business that I'm involved in.
I'm reasonably familiar with python and java if libraries for keyboard emulation exist but would be happy interpreting a pseudo code response too.
Responses that point to existing providers of such functionality that is embeddable or that tell me if I'm barking up the wrong tree also gratefully accepted.
Once again apologies as I know this isnt intuitively the best spot for this. Please do point me to a better location if you know of one.
Thanks
Possible solutions exist but they're all pretty bad
Is it a desktop application or a web application? If it's a web application you can use ghost.py to automate the interaction and submission of new records/entries. This work will be a glorious bundle of fun for the lucky code jockey who draws the short straw.
If it's a desktop application, it will be a great deal more difficult. Is it on Windows? Linux? MacOSX? Is the software written in Java? Using the Swing toolkit? AWT? SWT?
If it is a native Windows application you might be able to use Autohotkey to automate desktop interaction. This can be as basic as automatic clicks in pre-recorded parts of the screen, automating TAB keypresses to move around the input cells and reading input text from a data file and writing that out into the input cells. This will be even more entertaining than the web-solution mentioned earlier: truly the necessary ingredients for an authentic war story worthy of the annals of internet lore.
This is likely to be a lot of intricate work, error-prone, and subject to failure in the future if the UI of the software is changed; and such changes are very likely. It would be a lot easier to help if you could add more detail to the question.
Before embarking down this road, if I were you I would beg and plead with the software vendor to either provide me with an upload API; I would even offer to pay the vendor to upload my data for me. I cannot imagine either of the solutions I mentioned will be any cheaper, unless the work time of your developers has no value.
Good luck.

Reduce HTML using Applets

My supervisor has tasked me with programmatically reducing a website's content by looking at the HTML tags to reveal only the core content. Importantly, this particular piece of the project must be written in Java.
Now having learnt about the differences betweenPlugins, Extensions, Applets, and Widgets, I think I want to use an Extension that calls a client-side Applet. My approach was going to be this:
Using the Google-Chrome API, I was going to display a button that
the user can click.
If clicked, the action is to launch a new browser tab that has the
Applet embedded within it.
The applet automatically sources the called tab's HTML code and
filters it.
Once filtered, the reduced copy of the original site appears.
So I have a few questions. To start, is it even possible to use an Extension with an Applet? Moreover, is it possible for an applet to look # another tabs HTML code? If not, is it possible to just reload the original tab with the Applet now embedded within it and complete the function. Thanks.
Javascript is already on most mobile web platforms. Java is not, and there is no reasonable way mobile customers will be able to install Java. Android, which runs many, but not all, mobile devices has a Java run time environment, and is basically a loader for Java apps. But an Apple iPhone is not an Android device... nor is a Windows Phone.
If you want to summarize content on the client, and in Javascript, as I see it you have two choices:
Succeed with some inner burst of genius where dozens of the best expert PhDs in Natural Language Computing have just begun exploring how to extract "true meaning" from text; OR
look at document.title and be done with it.
The 2nd approach assumes that the authors of web pages set titles and set a title appropriate for summarizing their website. This isn't a perfect assumption, but it is OK
most of the time. It is also a lot less expensive than #1
With the 1st approach you can get a head start with a "natural language toolkit" that can do things like scan text for unusual words and phrases. To get a rough idea of the kinds of software that have been built in this area, review wikipedia: Outline of natural language processing:: toolkits. A popular tookit for python is called NLTK. Whether you use a toolkit from java, or python, it means working on the server because the client will not have the storage, network speed, or CPU. For python there are server side app frameworks like django or web2py that can make building out a server app faster, and on Java there are servlets frameworks. Ultimately you'll need a lot of help, training, or luck and as I have hinted above it can easily be beyond the capabilities of a small team of fresh hires, and certainly way beyond what a single new developer eager to prove his/her capabilities can do in a few weeks on their own with limited help.
Most web pages have titles set like this near the beginning of the downloaded HTML:
<head><title>My Furry Kittens!</title></head>
You don't need to write a parser. If you are running in the browser, the title has been parsed into the DOM or Document Object Model already. The string "My Furry Kittens!" in this example would be available in the global variable document.title.
If you like, you could put a button into a plugin and let people push it to summarize the website. Or, they could just look up at the title. It is already on the page. Of course, if the goal is to scrape titles one can avoid writing a parser and use a "fake" headless scriptable browser like phantomJS or similar.
You can read more about document.title on the Mozilla Developer Network. MDN is a great reference for learning how web browsers work. They are the maintainers of the Mozilla Firefox browser. Most of what you can learn there will also work on Chrome, Internet Explorer, and various mobile platforms.
Good Luck!
How about implementing a local proxy server on the mobile device. The browser would just need to be configured to use the proxy, while the custom proxy implementation can transform the requested html however it likes.

Recommendations / advice needed for application technology set

I have an idea for a GUI application, however it needs a set of technologies that i do not use frequently (as such i am a bit of a novice here, apologies if this is stupid!).
I want a 3D Earth Model, (like google earth, the actual look to be like the terrain overlay in google maps (I don't care about roads, just height & position)). Like google maps & google earth i will wish to add my custom tracks & locations & boundaries; and move / pan / tilt etc...
I cannot however be continually connected to the internet. So i will need a 1 time download of terrain/geodata before i startup the program. (Can this be done as a single kml dataset ? (Is that even correct?) i guess i would need a 'local map server' instead of an internet connection?)
I will need to use a precompiled language (preferably java) to actually write the program in. (Scripting / Javascript is not acceptable) Can i interface Java & KML using an existing library ?
Is it possible to reproduce the google maps 'map window' with the terrain imaging in 3rd party software ? (Can i pull this from open source somewhere?)
Everything you want to do is possible -- however -- let me preface this by saying that it will be a long, difficult journey.
Let's start with the easy thing: you can load your data as KML, it will show up as a layer in Google Earth, and you'll be able to turn it on and off. You'll also be able to turn off default layers (roads, etc) either programmatically or via the GUI.
I would use Google Earth (the web plugin thing) tied to a C# application. You do not want to use the old Google Earth COM API. It was deprecated by Google as of GE 6, and was truly a terrible thing to work with. Java could also work, but I prefer C# development. In either case, you can use the language's ability to call into the Google Earth API directly.
Here's a good example (C#). It's GNU/GPL, so it may work as a base for your app:
http://code.google.com/p/winforms-geplugin-control-library/
Essentially, you load a Google Earth web page in a WebBrowser control, which allows you to manage it directly. Actually interfacing with the web page is the hard part (but still easier than the COM API!) -- hopefully you can use the control library linked above to get a feel for how it works.
As for your internet connectivity issue: yes -- Google Earth (even the web plugin) supports caching. The exact amount of cache that is allowed is ~100 MB. Exactly what goes in the cache is a complete mystery. The 100MB limit won't get you very far -- but you can create larger caches (up to 2GB) using the full Google Earth app. These caches work with the web browser plugin, you just have to copy the database file into the Google Earth application data directory (and rename the file I think -- the plugin appends a 0 or something to the file name.) The process for creating a cache is simple -- fly around the area in question at the altitude you'd like. There are tools to help automate this, such as:
http://bx11.110mb.com/gecacher.htm
Note that caching Google's data isn't exactly what they'd like you to do. So please keep in mind that you'll need to fully review the EULA to make sure you're not violating it...
Good luck! I've been working with GE in a large app for ~3 years; It's definitely a fun thing to work with and can make your application really stand out.

Java VNC Applet vs Screen Capture

I am trying to make an application in which one component captures the screen of the user (for screen casting). I am aware that there are two options to achieve the same using a Java applet (please correct me if I am wrong). First is to use the java applet to take screen shots continuously and convert it into a video and upload it as a video file. And second is to create a java vnc server and record it as a .fbs file and play it using a player like: http://www.wizhelp.com/flashlight-vnc/index.html
I would like to know the best solution in terms of video quality, file size, cross-platform compatibility (windows and mac), firewall problems and finally ease of implementation.
I am very new to Java. Please tell me whats the best solution for my problem. Also, is it easy enough for me to program it on my own or should I get it developed via a freelancer. I have tons of programming experience (5+ years in LAMP) but none in Java.
Thank you very much.
I agree that this is pretty hard. I implemented those two solutions (VNC and onboard screen capture) plus a third (capture from an external VGA source via an Epiphan grabber) for a former employer. I had the best bandwidth-to-quality ratio with VNC, but I got higher framerate with VGA capture. In all three cases, I reduced the frames + capture times to PNGs and sequenced them in a QuickTime reference movie. Then I made flattened video (MPEG4 or SWF) of the results. In my case, I then synchronized the screen video with a DV stream.
In the end the technology worked (see a sample of the output) but our business model failed.
From what I know, the older versions of applet had security restrictions that may not allow for screen capture. Instead, a java application may be feasible.
Regarding the build-it-yourself vs the fire-a-coder, it depends on how you value your time compared to what you can find on a freelancer site.
I think you can find someone from India/Romania/Poland/Other countries that can make it for an affordable price
Given your Java knowledge and the difficulty of the task, have you considered taking an alternative approach? For example, how about a native VNC server for the end-user, which is just a small download and then they click "Run." And that native server is programmed to capture the screen and send it straight to your web server, which has a client like vnc2swf or other means of converting the VNC stream to a video or .fbs file? Does all that make sense?
Admittedly, without Java, you have to prepare one executable program per platform you want to support, however, I don't know. That still sounds easier to me. Consider Copilot.com. They are doing VNC but they still use small native apps for each platform.
Sorry but this seems the kind of job that requires a lot of experience. Even if you find code snippets all around the net to fix this and that, the overall result may be way worse than simply hiring an experienced Java programmer.

Categories