I can get the data from another application of the same topic - java

I have an application for students, but I see that users do not like the idea of re-entering all their information (of agenda and subjects) from scratch, I would like my application to have the option to "get data from X application if it detects that is installed ", just like the browsers Firefox and Chrome when you switch from one to the other they offer to import the history and other data. Some of the target applications allow you to export your SQLite databases and you could start there, but is it possible? is it legal? is it good practice?
If the answer is positive, some recommendation based on your experience?

Related

Selenium WebDriver like tool for desktop application

I am struck up in my below task, hope this idea will be very useful for many.
In my company they use several Health Monitoring tool and we do the Health Checks manually.
We have a separate health check plan and process, where we go to Web Applications like Site Scope or open certain jars like Spectrum CA (runs as a JNLP file) and check for the server status/health data manually.
As we have more than 50 monitoring tools like that I suggested to automate the Health Checkups.
Initially I was suggested to do the automation using Python but I am a JAVA Web developer so I moved to Selenium/Jsoup and use Web-scraper concept to fetch the information and do the health checkups. I am able to do considerable progress using Selenium to automating the manual Health Checks using the Web Application.
Problem: As I mentioned we also need to do certain health checkups using jar, desktop apps or jnpl file (applet), I am not sure on how to proceed in automating these. We are not supposed to use any paid tools or unreliable freeware which record and replay the manual desktop operations.
I do not have any idea on those, so can you please suggest me a tool or testing automation tool for these Desktop applications where I should be able to LogIn into it, Enter some text in the TextBox, Search, filter, navigate and get a value and finally verify whether the health is green ?
Note: Few of the application are legacy application so they don't use any api calls.
There are 2 free tools which can cater to your needs which can be used alongside Selenium w/ java:
1) AutoIT - good for window based applications
2) Sikuli - an image based automation Tool
I do not have any idea on those, so can you please suggest me a tool or testing automation tool for these Desktop applications where I should be able to LogIn into it, Enter some text in the TextBox, Search, filter, navigate and get a value and finally verify whether the health is green ?
For the above question, Winium can be used for desktop app automation. It is similar to Selenium. You can write code in java to automate the process. below is the git link for Winium.
https://github.com/2gis/Winium.Desktop
I was looking at FlaUI, you can have a look at this as well. This works with c# though
https://github.com/Roemer/FlaUI

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.

Run remote app but not the entire desktop

In the company where I work we have, among others, an application made in Java running on two places (let's say Merida and Coatza) and both have different databases. The users from Merida only occasionally used the program to get some info or capture things. Now the company owner decided to control almost everything from Merida but we cant get the databases merged due to operation logistic.
The thing is that when the application uses the persistence-unit to connect coatza it's incredibly slow since the app its not prepared to use remote databases (at least not with a high performance).
I thought of something like teamviewer to run the app remotely but not the database, however I don't want to run the complete desktop, only the application. Or develop a part of the program on JCurses so it can be run from coatza but there is not enough documentation and we use a lot of tablemodels.
Is there something I could do?
The application is a DesktopApp. We use Jboss 5 as server. Hibernate and JPA.
I had a similar situation where we needed to use the same application at different locations because the license was too expensive. I used a feature called RemoteApp on Windows Server 2008. The best part is that you can have a desktop shortcut for any app on a remote computer and all you need to do is open it and login and only that particular app starts running instead of the whole desktop. There is also a web interface for remoteapp so that you can simply login and select whichever app you want to run. For more details take a look at http://www.techotopia.com/index.php/Configuring_RemoteApps_on_Windows_Server_2008

Wondering about capabilities of titanium appcelerator?

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.

Run SQLite commands on database in one app from another

I have an SQLite database stored in the assets resources of one application used to load UI and other stuff into the app, mainly just holding text nothing out of the ordinary. I want to be able to get a writable version of this database so I can modify it from another application.
Example:
First application is on the market with limited number of enabled features. User gets to a certain point where they need to buy extra content to do more stuff in the app. The original app has these features but they are not enabled in the app using the database. I want the user then to download a second app from the market which is just used to change one field in the database from disabled to enabled thus unlocking the new features.
I have an idea I may need to use content providers but my understanding is once created they are accessible to all applications. I need it, for piracy reasons I guess, to only be able to communicate with apps signed off by my key.
Thanks
Sam,
I understand what you intend to do, but you are going about it the wrong way. Your 'Unlock App' would not be able to modify the Database in the assets folder of your 'Free App'. That's just general android security model stuff.
You may want to look at this question: How can I use the paid version of my app as a "key" to the free version?
It describes how you can create a 'Unlock App' on the market to unlock features of your 'Free app' without needing to actually modify any of the original data in the 'Free App'.
Good luck

Categories