From an Activity To start a new Activity from another Activity: Intent intent = new Intent(this, OtherActivity.class); startActivity(intent); From a Service Intent intent = new Intent(this, OtherActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); (adsbygoogle = window.adsbygoogle || []).push({}); From somewhere else To start an Activity...
Read More
On one of our projects, we were asked to implement a process that updates a database with values from an Excel file on a daily basis. The file is located at https://github.com/jbaysolutions/excel-xml-reader/raw/master/ActiveSubstance.xls. The problem with this file is its format. It's an...
Read More
If you are following the tutorials here you must be dying to do some queries using JPA. So, before we go any further into other aspects of JPA, lets query the model! For this task, instead of using SQL we will be using the Java Persistence Query Language or also...
Read More
We have just covered the subject of Many-To-Many relationships, which is a fun topic for the hole family! Now there are some particular cases on the Many-to-many front which are not particularly hard, but can lead to a bit of confusion. One of those particular cases is the M2M with...
Read More
So, we have already dabbled into Relationships in JPA, in particular One-To-Many and Many-To-One. It is now time to give a look into Many-To-Many, which is very similar to One-To-Many Relationships. So at this point you should have read the previous two tutorials on JPA 2, but if for some...
Read More
Recently I had to write some code to generate excel files using Apache POI. One of the files was fairly complex and used formulas in a few cells. I found myself spending a few hours searching for a way to translate the indexed column numbers that POI uses to the...
Read More
The default glassfish app. server installation comes with local JMX connections enabled by default. To enable JMX connections from remote hosts all that's needed is to add -Djava.rmi.server.hostname=<hostname> in the JVM Options of the instance of GlassFish, where <hostname> is the external...
Read More
Multi Threading is one of the most interesting subjects when developing applications, be them in Java or any other Language: The ability to have ones software performing multiple tasks at the same time, maybe handling multiple requests from users, parallel processing things... wicked stuff really! On the other hand... when...
Read More
Following from the previous tutorial we now dive into move interesting and complex parts of JPA 2: Relationships! In this tutorial we'll be focusing on One-to-Many relationships (mainly Bidirectional), looking into their particularities (specially related to the Cascading of operations), we'll create a JUnit Test class for testing the Relationship,...
Read More
So, one of the most common comments I get to hear while at work almost every week regarding JPA is : "Oh I Just hate JPA!" . I never really had much of a problem with it, obviously sometimes with JPA something just doesn't want to work for some strange reason and...
Read More