Saturday, October 24, 2015

Android Installs in 2015

Here are my GLOBAL Android Installs (40,000 sample)

CURRENT INSTALLS 2015 to date



Android 2.3 - 11% - unchanging to slowly decreasing
Android 3.2 - 2% - unchanging to slowly decreasing
Android 4.0 - 13% - unchanging to slowly decreasing
Android 4.1 - 14% - unchanging to slowly decreasing
Android 4.2 - 15%  - unchanging
Android 4.3 - 3% - unchanging to slowly decreasing
Android 4.4 - 26% - increasing
Android 5.0 - 5% - sharply increasing in summer 2015, leveling
Android 5.1 - 3% - sharply increasing since October 2015


DAILY INSTALLS October 2015

Android 4.4 - 50%
Android 4.2 - 20%
Android 4.1 - 8%
Android 5.x - 13%


If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Wednesday, July 29, 2015

git command line on Mac

I had to start using a new Mac, so it was good time to review my toolset.

$ git --version
git version 2.3.2 (Apple Git-55)
$ which git/usr/local/bin/git


After the brew install

brew install git
...
$ git --version
git version 2.2.0
$ which git
/usr/local/Cellar/git/2.2.0//bin/git


it seems that the version of Brew is older, so I advise staying with Apple (Developer's Tools).





If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Thursday, June 25, 2015

Java: Unsupported major.minor version 51.0

When you get an error:

Unsupported major.minor version X

This means that you are trying to compile your Java program with version lower that the code is written for; for example you develop with Java 1.7, deploy on the server where they have Java 1.6:

Unsupported major.minor version 51.0

The fix is:

  • to change your code to use lower Java, which is sometimes impossible because of 3rd party library that you are using
  • upgrade the other computer to modern Java, which is sometimes impossible because of a brick-head gatekeeper
  • vent on the blog and start cutting out the code 


Java versions:
  • J2SE 8 = 52
  • J2SE 7 = 51 
  • J2SE 6.0 = 50 
  • J2SE 5.0 = 49 
  • JDK 1.4 = 48 
  • JDK 1.3 = 47 
  • JDK 1.2 = 46 
  • JDK 1.1 = 45

If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Monday, June 22, 2015

RoboGuice - Android development made simple and fun



"Simple and Fun!" Now, they make quite a promise!

read up:

https://github.com/roboguice/roboguice/blob/master/README.md

https://github.com/roboguice/roboguice/wiki

Maven repo:


org.roboguice
roboguice
3.0.1


OK, so most of all RoboGuice is about DEPENDENCY INJECTION



Examples:


@InjectView(R.id.label)
TextView label;

@InjectResource(R.string.app_name) // strings, drawables
String applicationName;

@Inject // system service
LayoutInflater layoutInflater;

@Inject
LocationManager locationManager;

@Inject // POJO
Book book;


Creating Activities



public class FightForcesOfEvilActivity extends RoboActivity {

@InjectView(R.id.expletive) 
TextView expletiveText;

Creating Android Modules


public class MyModule extends AbstractModule {
@Override
protected void configure() { }



AsynchTask 


public static class AsyncPunch extends RoboAsyncTask {

// Astroboy is a @Singleton public class Astroboy {
@Inject Astroboy astroboy;

// new instance of java.util.Random, since we haven't specified any binding instructions
@Inject Random random;


If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

SHH key

$ git clone git@github.com:roboguice/roboguice.git
Cloning into 'roboguice'...

Permission denied (publickey).


$ ls -al ~/.ssh
total 120
-rw-------   1 uki  staff   1675 Oct 31  2012 id_rsa


COPY YOUR PUBLIC KEY to clipboard

$ pbcopy < ~/.ssh/id_rsa.pub 


PASTE your SSH key exactly as copied (i.e. in GitHub settings)
https://github.com/settings/ssh


$ git clone git@github.com:roboguice/roboguice.git roboguice
Cloning into 'roboguice'...
remote: Counting objects: 18463, done.

Receiving objects:  15%

If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Tuesday, June 16, 2015

MacBook Pro (late 2011) graphics crashing

With the update to Yosemite (maybe unrelated) my Mac started to crash, at first it was rare, but right now it is consistent, the common situations when it is crashing:


  • connecting external monitor via HDMI
  • connecting external monitor via VGA
  • screen sharing using JoinMe 
  • bad days in general
The MacBook Pro (starting with early 2011) have 2 GPU (graphic cards), one integrated, low power, and one additional (discrete) that is used for high power situations.

I installed the utility called gfxCardStatus that allows me to switch between integrated and discrete graphic cards.

From their website:

gfxCardStatus v2.3 and above actively prevents you from switching to Integrated Only mode when any apps are in the Dependencies list (or if you have an external display plugged in). This is because if you were to do this, your discrete GPU would actually stay powered on, even though you've switched to the integrated GPU.

So I guess no more external display for me until Apple fixes the problem, or I but new MacBook Pro (hopefully with touch screen this time).




https://developer.apple.com/library/mac/qa/qa1734/_index.html



Reseting System Management Controller (SMC)

https://support.apple.com/en-us/HT201295

If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Thursday, June 11, 2015

Java: Closable

When working with multiple resources that need to be closed after we are done using, I particularly like the approach of using Closable Interface:


try {
    // open input streams and use them  
}
catch (IOException e) {
    e.printStackTrace();
}
finally {
    attemptClose(inputSteamA);
    attemptClose(inputSteamB);
}



private void attemptClose(Closeable object) {
    if (object != null) {
        try {
            object.close();
        }
        catch (IOException ignore) {
        }
    }
}




If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Apple Photos opening every time phone USB is connected

I work developing Android so I plug and unplug different devices all day long. Apple Mac Photos app is opening every time phone USB is connected, which is frustrating and sometimes out of place at work.

To turn off that behavior next time the Photos app opens UNSELECT THIS CHECKBOX:

"Open Photos for this device"


If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Android: TextView in ScrollView continous scrolling

Sometimes when continuously outputting text to TextView, you would like it to scroll down:



textView.addTextChangedListener(new TextWatcher() {
    @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) {
    }

    @Override public void onTextChanged(CharSequence s, int start, int before, int count) {
        // scroll down whenever log text updated to display latest info on the screen        
        
        scrollView.post(new Runnable() {
            @Override public void run() {
                scrollView.fullScroll(ScrollView.FOCUS_DOWN);
            }
        });
    }

    @Override public void afterTextChanged(Editable s) {
    }
});

If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Monday, June 8, 2015

Android: AsyncTask delegate

Let say we have an Activity that wants to receive a messages from AsyncTask.


We create an Interface AsyncResponse

public interface AsyncResponse {
   void publishLog(String logContent);
}

We create our AsyncTask:

public class FileReaderTask 
 extends AsyncTask < Void, Void, List < AbstractX > > {
// delegate should be set in the Activity   
public AsyncResponse delegate = null;
String xyz = "";

// ...

@Overrideprotected void onPreExecute() {
   delegate.publishLog(xyz);
}

@Overrideprotected void onPostExecute(List x) {
...
      delegate.publishLog(xyz);
   }
}

Now we can tie together the AsyncTask and Activity:

public class FileReaderActivity extends Activity implements AsyncResponse {

   private static final String TAG = FileReaderActivity.class.getCanonicalName();
   FileReaderTask asyncTask = new FileReaderTask();

   private TextView logText;

   /**    * Called when the activity is first created.    */  

 @Override   public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      logText = (TextView) findViewById(R.id.logText);

      // tell Async Task that this Activity will listen      

asyncTask.delegate = this;
      asyncTask.execute();
   }

   /**    * This method will receive log from Async Task.    * @param logContent    */   

@Override   public void publishLog(String logContent) {
      logText.append(logContent);
   }
}


If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Android: finding SD Card

Since the implementation of SD card is different on various devices use following method:


private static final String SDCARDFILE 
Environment.getExternalStorageDirectory() 
+ "/somefolder/somefile.ext";

If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

git: updating all repos using Bash

I have a lot (hundreds) of repositories I want to keep updated on daily basis, here is a handy script I use:


# saving current working directory
cwd=$(pwd)

echo "reading each repo directory in $cwd"
for repo in *
do
echo '#################################################'
# change to give repo directory
cd $repo
# print repo url
    git config --get remote.origin.url
    git fetch
    git status
    # go back to directory you started with
    cd $cwd
done
}

If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Tuesday, June 2, 2015

Android Studio Canary

In case you feel adventurous you can try hottest builds from Canary releases:

http://tools.android.com/download/studio/canary

Why would you wan to do that?
For example Android Studio 1.3 (2 days old) has support for NDK.

Monday, June 1, 2015

ATAP

Forget the Google I/O keynote presentation, this is the real "state of the art" of 2015



Friday, May 22, 2015

Linux tail command

To constantly monitor log files being appended, you can use:


tail -f /var/log/xyz*.log

if you want to see last 200 lines added:

tail -n 200 /var/log/xyz*.log

note the asterisk "*" symbol, that monitors ALL logs that meet the pattern, which is helpful with log names ending with DATE.

Tuesday, May 19, 2015

Groovy

Groovy Installation



$ curl -s get.gvmtool.net | bash

$ source "/Users/uki/.gvm/bin/gvm-init.sh"

$ gvm install groovy

$ groovy -version

Groovy Version: 2.4.3 JVM: 1.7.0_79 Vendor: Oracle Corporation OS: Mac OS X

$ which groovy

/Users/uki/.gvm/groovy/current/bin/groovy


To add Groovy permanently to your Terminal  PATH

edit ~/.bash_profile
# Groovy updated May 19, 2015
export GROOVY_HOME=/Users/uki/.gvm/groovy/current
export PATH=${PATH}:${GROOVY_HOME}/bin


First Script


groovy_scripts $ cat hello.groovy 

println 'Hello from Groovy'
groovy_scripts $ groovy hello

Hello from Groovy




Groovy Console


Groovy Console is good for quick testing of Scripts, especially copy and paste from the Web.


$ groovyConsole








interface Alive{
   void alive()
}

class Creature implements Alive{
    def grawl() {
        println(" Grrrrrrrr!!! grawls the Creature")
    }
    void alive()
    {
        println(" Grrrrr!!! thinks the Creature")
    }
}

class Human extends Creature {
    String name;
    def sayHi(name) {
        println(" Hi, my name is $name! says the Human")
    }
   
    void alive()
    {
        println(" I am alive! says the Human")
    }
}



Creature me = new Human()
me.grawl()
me.alive()
me.name = "Uki"
me.sayHi me.name

Creature bear = new Creature();
bear.alive()


OUTPUT:

uki@ groovy_scripts $ groovy hello
 Grrrrrrrr!!! grawls the Creature
 I am alive! says the Human
 Hi, my name is Uki! says the Human

 Grrrrr!!! thinks the Creature



If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Groovy as DSL

http://docs.groovy-lang.org/docs/latest/html/documentation/core-domain-specific-languages.html

If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Hadoop on Pi cluster

http://www.widriksson.com/raspberry-pi-hadoop-cluster/

Thursday, May 14, 2015

UNIX: create symbolic link ln -s

Symbolic link is a directory that points to another directory:

$ sudo ln -s TARGET_DIR SYMBOLIC_LINK_DIR



Example 1:

$ cd /System/Library/Frameworks/JavaVM.framework/Versions

$ sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/ "1.8.0_20-ea"
$ ls -alt
lrwxr-xr-x  1 root  wheel   59 May 14 16:24 1.8.0_20-ea -> /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/


Example 2:

Debian linux Apache location: /var/www
Mac Apache default location: /Library/WebServer/Document

On Mac to mimic the Debian linux's Apache server in /var/www you can create a symbolic link that points to Mac's default server location:


$ sudo ln -s /Library/WebServer/Documents www



originally posted on 7/24/2009

If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Switching version of Java on Mac

To check the currently installed version of java on your Mac:

$ java -version
java version "1.6.0_65"


(Welcome back to 2006!)


You can download Java 1.7, 1.8 and 1.9 at Oracle and write down WHERE they install it:

http://www.oracle.com/technetwork/java/javase/downloads/index.html




Using SYMBOLIC LINKS I created locations of my various Java locations:

sudo ln -s location_of_JDK "version_name"



for example:

$ sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/ 1.8.0_51




Uki@ Versions $ ls -al
total 72
drwxr-xr-x 12 root wheel 408 Jul 29 12:03 .
drwxr-xr-x 11 root wheel 374 Jul 29 11:50 ..
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.4 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.4.2 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.5 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.5.0 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.6 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.6.0 -> CurrentJDK
lrwxr-xr-x 1 root wheel 59 Jul 29 12:03 1.8.0_51 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/
drwxr-xr-x 7 root wheel 238 Jul 29 11:50 A
lrwxr-xr-x 1 root wheel 1 Jul 29 11:50 Current -> A
lrwxr-xr-x 1 root wheel 52 Jul 29 11:50 CurrentJDK ->/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents
Uki@ Versions $


now I can switch my Java to 1.8 by redirecting CurrentJDK:

Uki@ Versions $ sudo rm -r CurrentJDK
Uki@ Versions $ sudo ln -s 1.8.0_51 CurrentJDK

Check that change took place: 


Uki@ Versions $ ls -altotal 72
drwxr-xr-x 12 root wheel 408 Jul 29 12:07 .
drwxr-xr-x 11 root wheel 374 Jul 29 11:50 ..
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.4 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.4.2 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.5 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.5.0 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.6 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 29 11:50 1.6.0 -> CurrentJDK
lrwxr-xr-x 1 root wheel 59 Jul 29 12:03 1.8.0_51 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/
drwxr-xr-x 7 root wheel 238 Jul 29 11:50 A
lrwxr-xr-x 1 root wheel 1 Jul 29 11:50 Current -> A
lrwxr-xr-x 1 root wheel 8 Jul 29 12:07 CurrentJDK -> 1.8.0_51
Uki@ Versions $ java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)










~~~~~~~~~~~~~~~~~~~~~~~










It is also useful to create JAVA_HOME as a lot of apps use that.




Open your shell startup script, most of the time it is ~/.profile







edit ~/.profile






--------------------------------

# JAVA updated: May 14, 2015
# other versions: /System/Library/Frameworks/JavaVM.framework/Versions/
# set up what CURRENT points to
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
# add Java home to path
export PATH=${PATH}:${JAVA_HOME}/bin






--------------------------------






$ java -version


java version "1.8.0_20-ea"


Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b05)



Java HotSpot(TM) 64-Bit Server VM (build 25.20-b05, mixed mode)










If you mess up you will get messages like:


$ java -version



Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/bin/java" (-1)






That is because the folder you point at has to have /bin/java in it.


Please note that your system Java level is independent from you Android Eclipse Java setting (1.6)









http://stackoverflow.com/a/23396850/3566154










If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

Tuesday, May 5, 2015

Java: Generics, instanceof

In this exercise you will practice Java Generics, and instanceof operator




Note, you will have to implement Book, EBook and PaperBook classes on your own.








Java: concurrency with Runnable

In this simple tutorial we will see how to process some work in multiple threads using limited pool of x threads. Please note that there is an overhead in using threads.

You could use number of available CPUs as your pool size.



Result:


CPUs 8
thread with value 1 current sum 3
thread with value 2 current sum 3
thread with value 3 current sum 6
thread with value 4 current sum 10
thread with value 5 current sum 15
thread with value 6 current sum 21
thread with value 7 current sum 28
thread with value 8 current sum 36
final sum 120
thread with value 11 current sum 66
thread with value 13 current sum 91
thread with value 15 current sum 120
thread with value 9 current sum 45
thread with value 14 current sum 105
thread with value 12 current sum 78
thread with value 10 current sum 55

Tuesday, April 28, 2015

Android: Create Camera App in IntelliJ


Create new Android Module






Name the application
Name the main Activity class




Name the Module and its location
Choose API 17 or higher





  • In Preferences, find Java Compiler
  • Add your project (AndroidCamera)






Set Java Compiler to Java 1.6





Set Module Language Level also to Java 6





Run the MainActivity class




Select emulator








follow the code tutorial :

http://tech.ukidlucas.net/2014/11/android-camera.html




Tuesday, April 21, 2015

Java: introduction to Java Android programming

Since Android is one of the most prolific uses of Java UI today, we will do a short overview of that platform. We will use the same IntelliJ IDEA we use for or regular java programming.

Android SDK setup:

http://tech.ukidlucas.net/2014/09/android-sdk-set-up-in-ide.html


First of all we have to make sure our IDE has Android plugin:




Download at least one SDK level e.g. API 17:






Create a new Android MODULE:




Name the Module:




Accept default Module SDK, you should have API 17 or up:





Set output path:



Try to run the project:








Android (with ANT) project structure, please not it is different from Maven, or Gradle structure:




We will create an app as such:






With following structure:



















Please follow the rest of the tutorial here:

http://tech.ukidlucas.net/2014/11/android-mediaplayer.html

Maven: executing JAR created with Maven

In this tutorial we will learn how to create an executable jar with Maven and run it from command line.


Let's add a maven-jar-plugin to your pom, make sure you specify your main class as such:

<mainClass>exec.MyApp</mainClass>





Run Maven:

uki@ JavaFxSceneSwitch $ mvn clean install[INFO] Scanning for projects...[INFO]                                                                         [INFO] ------------------------------------------------------------------------[INFO] Building JavaFxSceneSwitch 1.0-SNAPSHOT[INFO] ------------------------------------------------------------------------...[INFO] Installing .. to /Users/uki/.m2/repository/edu/clcillinois/cit137/JavaFxSceneSwitch/1.0-SNAPSHOT/JavaFxSceneSwitch-1.0-SNAPSHOT.jar[INFO] Installing ...[INFO] ------------------------------------------------------------------------[INFO] BUILD SUCCESS[INFO] ------------------------------------------------------------------------[INFO] Total time: 1.822 s[INFO] Finished at: 2015-04-21T14:57:43-05:00[INFO] Final Memory: 15M/91M[INFO] ------------------------------------------------------------------------



Run the app from the ROOT of your project:


uki@ UKI_LUCAS $ java -jar  /Users/uki/.m2/repository/edu/clcillinois/cit137/JavaFxSceneSwitch/1.0-SNAPSHOT/JavaFxSceneSwitch-1.0-SNAPSHOT.jar



The JavaFX app should start, if you start it from other folder, observe how the Image path behaves.

JavaFX: switching UI content

In this tutorial we will learn how to switch the UI content of JavaFX Stage using multiple Scenes.
We will crate a simple app that has 3 buttons which change the UI content with the Image shown.





Project Structure



We will start by creating out main Application class which will have member variables which will be references elsewhere:


  • app width
  • app height
  • 3 Scene classes - separate pages we want to show
  • common navigation Pane


The navigation in this project is a simple 3 button VBox Pane, since you will want to improve on it and create a more fancy IMPLEMENTATION of this navigation, let's agree to an interface:



And now the simple implementation of our navigation Pane.




When we are asking for the navigation Pane we pass in some identifier of our own choice:



Next we will create couple of Scene classes, but since they will all adhere to the same pattern let's define a common UI interface:





















Now we can implement 3 of our Scenes, they are very simple thanks to refactoring of the common code.


































Since the pattern of adding Image is the same in all Scenes we created a utility class for that:

































Android: software keyboard

If you don't want a full screen keyboard try flagNoFullscreen option:

android:imeOptions="flagNoFullscreen|actionDone"

Monday, April 13, 2015

Java: volatile and synchronized block


In this tutorial we explain when to use volatile modifier for the variable.

Example:

Any non-main UI threads can change status of connection to a given service.

protected volatile boolean serviceConnected = false;


Explanation:
Since the variable can be changed by multiple threads, this means that the variable should not, and will NOT be cached locally in the thread, but in the MAIN MEMORY.

Volatile does pretty much the same as wrapping the variable in synchronized block, with few exceptions:

  • Unlike synchronized, the volatile can be used with java primitives.
  • Volatile allows NULL values, since you synchronize on the reference 
  • Synchronized block does not allow NULL as is synchronize on actual object
  • Synchronized has blocking access that is updating when entering or exiting the block.

Thursday, April 9, 2015

Android on Mac VirtualBox

In this tutorial we will learn how to Install Android on Mac Using VirtualBox:

Watch this excellent tutorial video:
https://youtu.be/K-z6NxDWfZA

Download android-x86-4.4-RC2.iso (very slow, go out for lunch):http://sourceforge.net/projects/android-x86/files/Release%204.4/android-x86-4.4-RC2.iso/download

Download Oracle VirtualBox for Mac x86
http://download.cnet.com/VirtualBox/3000-2094_4-145711.html




















Tuesday, April 7, 2015

SQL INNER JOIN



SELECT placemark.name
FROM feature
INNER JOIN placemark
ON feature.placemark_id=placemark.id;

java.sql.sqlexception: [sqlite_error] sql error or missing database (no such table:

When trying to open the database you may get the following exception:


java.sql.sqlexception: [sqlite_error] sql error or missing database (no such table:


even if it looks like the TABLE is missing, in reality the path to the database may not be fully defined.

Consider Incorrect:

private static String databaseFilePath = "kml.db";


Successfully opened connection to jdbc:sqlite:kml.db using org.sqlite.Conn
SQLException for kml.db
Connection closed!
java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such table: placemark)


and Correct:

private static String databaseFilePath = "/Users/uki/_REPO/CLC/2015_spring/cit137/UKI_LUCAS/XmlParsing/kml.db";


Successfully opened connection to jdbc:sqlite:/Users/uki/_REPO/CLC/2015_spring/cit137/UKI_LUCAS/XmlParsing/kml.db using org.sqlite.Conn

If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins

IntelliJ IDEA: Database plugin

In this tutorial we will learn how to install the Intellij IDEA database plugin.

Start with opening Settings > search for plugins > search for database > click Browse



Install plugin "Database Navigator"
Note it does not support SQLite






Error:java: javacTask: source release 1.6 requires target release 1.6

Error:
Error:java: javacTask: source release 1.6 requires target release 1.6


For some reason IntelliJ started to DEFAULT to Java 1.5 on all my new projects, to fix that you go to:

IntelliJ IDEA > Preferences... > search Compiler > Java Compiler


  • select what default you want
  • adjust using drop-down your existing projects