Upgrade LG G3 Dual Sim (LGD 858HK) to Lollipop (5.0.1)

August 2, 2015 72 comments

Note: This post is 1 year old. Please read the comments to get the latest news.

I recently bought myself an LG G3 Dual SIM which came with Android KitKat 4.4.2. Hopeful to upgrade to Lollipop I went to the Upgrade centre. I was disappointed to receive the “You are running the latest version” message.

After an extensive search over the Internet I came across pieces of information on how to upgrade to Lollipop. I’ve managed to successfully upgrade my LG G3 Dual SIM (LG D858HK) to Android Lollipop 5.0.1. The process takes under 10 minutes. Moreover, several people have managed to perform the upgrade without problems. Read their comments on GSM Arena (http://www.gsmarena.com/lg_g3_dual_lte-reviews-6764p6.php).


Disclaimer: Please make sure to backup your phone prior to attempting the following steps. I’m not responsible for any damages that may occur.

1) Download the right KDZ file, containing Lollipop, for your LG G3 D858HK
Download location: http://lg-phone-firmware.com/index.php?id_mod=41

Screen Shot 2015-08-02 at 20.37.04

– HKG is for LG Dual SIM 32 GB.
– 6KB is for LG Dual SIM 16 GB.

When you click on the KDZ name, you are going to be sent to http://adf.ly. In the top right, select “SKIP AD” to be redirected to the actual download page.
2) Download Windows Driver for LG G3
Download location: http://www.mediafire.com/download/g31hbcdmh14io89/LGUnitedMobileDriver_S50MAN311AP22_ML_WHQL_Ver_3.11.3.exe
3) Setup the Windows Driver for LG G3
Run the executable that you have downloaded at step 2 and finish installation.
4) Download LG Flash Tool 2014 tool
Download location: http://www.mediafire.com/download/fwrcd3pdj0svjtb/LG+Flash+Tool+2014.zip
AFAIK Linux/Mac is not supported.
5) Extract archive with LG Flash Tool
6) Copy the KDZ file downloaded at step 1 in the LG Flash Tool 2014 folder (which was generated at step 4).
7) Backup all of your phone data
After the upgrade my phone data was wiped out and the factory settings were restored when Lollipop booted up. Be sure to perform a backup of your data!
8) Run LG Flash Tool
If you cannot run LGFlashTool2014.exe, please install Visual C++ Runtime Library : https://googledrive.com/host/0B9l4QO…tInstaller.exe

9) Boot your LG G3 in Download mode.

Here’s a 2-minute video on how to boot your LG G3 in Download mode: https://www.youtube.com/watch?v=x_1YLCfv630
Long story short:
A) power off your phone.
B) After that press the “Volume up button” on the back of your phone.
C) The “Download mode” should appear on your screen.
D) Connect the USB cable in your phone and in your PC.

10) In the LG Flash Tool do as following pictures :

A) Select type: CDMA
PhoneMode: DMG
Resettime: 33000
Browse to the KDZ files downloaded at step 1.
Select CSE Flash.


B) Leave the default options and click START.


C) Leave the default options, including Country and Language! Click OK to start upgrade. Don’t disconnect your phone from PC!


11) The upgrade takes 3 to 5 minutes.
12) Congratulations! You are now running Android Lollipop 5.0.1 on your LG G3 Dual SIM (LG D858HK) phone!
13) Leave a comment with your experience.



Categories: Uncategorized

SOLR: Insert large amount of documents with MapReduceIndexerTool

June 3, 2014 1 comment

The problem

I recently came across a problem which consisted in finding a way to insert a large amount of documents into a SolrCloud instance. For our use case, the MapReduceIndexerTool came to help.

The solution

The MergeReduceIndexerTool is a map-reduce job that:

  • takes some input files in raw format
  • applies a morphing line which generates Solr indexable documents
  • writes the Solr indexes into HDFS

Optionally, you can merge these indexes into a running SolrCloud instance, via the go-live feature.
For more information read here. There’s a caveat though: you can only insert new documents with this tool, you can not update existing ones (see here).


The input data can be anything that you can think of, serialized into some file(s). For our case we had some sequence files. Just as well, it could be plain-text, zip, tar and so on. The data format could also be JSON, AVRO, csv and so forth.
Therefore, we have this input data in raw format and we want to insert it into Solr. How do we do that?

1. Install SolrCloud

We began by installing SolrCloud via Cloudera. The SolrCloud instance was based on HDFS to keep the data.

2. Locate the MapReduceIndexer tool

This comes with Cloudera. If you’re not using Cloudera, I’m pretty sure you can install it manually, since it’s open source.

3. Copy the input data into HDFS

Let’s take some sample input files. Suppose we have CSV files

4. Write a morphline

The morphline is used to parse the raw input data into Solr indexable documents.
The morphline is a plain text that has a series of commands (see below). Each command manipulates the input and hands it over to the next one. They are pipelined, similar to Unix:

$ cat list1 list2 list3 | sort | uniq > final.list.

In the same way, we could have these morphline commands:

  • Deserialize file
  • Parse AVRO and extract fields
  • Eliminate those fields that are unknown to Solr
  • Manipulate fields. For instance:
    • Convert timestamp field to native Solr timestamp format
    • Optionally: Write custom logic – we can write/re-use Java classes and use them as a command

The MapReduceIndexerTool is going to use the morph output (which is basically a Java Map) and it is going to create the Solr indexes.

Some of these morphline commands come bundled with Cloudera and can be used as-is (avro/json/csv parsing, time convert etc.). We can also write custom commands (in Java) to suit our needs.
Suppose our input data are AVRO files. Let’s check the following sample morphline: here. As you can see, there are a series of commands:

  • readAvroContainer

Parse Avro container file and for each avro object, a new SOLR record is created

  • extractAvroPaths

Extract values from an Avro object. These will map to SOLR fields, defined in your schema.xml.

  • convertTimestamp

Optionally: Convert timestamp field to native Solr timestamp format

  • sanitizeUnknownSolrFields

Deletes those record fields that are unknown to Solr schema.xml

  • loadSolr

Instructs the map-reduce job to add the record to the Solr index.

For more examples check this GitHub project.

5. Run the MapReduceIndexerTool

We can now run the map reduce job, using the morphline we’ve just created and specifying the HDFS location where the input data lies.

$ hadoop jar /opt/cloudera/parcels/CDH/lib/solr/contrib/mr/search-mr-*-job.jar \
org.apache.solr.hadoop.MapReduceIndexerTool \
-D 'mapred.child.java.opts=-Xmx500m' \
--log4j /opt/cloudera/parcels/CDH/share/doc/search*/examples/solr-nrt/log4j.properties \
--morphline-file morphline.conf \
--output-dir hdfs://nameservice1:8020/tmp/outdir \
--verbose --go-live --zk-host localhost:2181/solr

6. Check the Job Tracker

We can now go to the JobTracker and check the map-reduce job status.

 7. Make a SOLR query

Once the job is done, let’s make a SOLR query to see if the documents have been inserted successfully.

Categories: Solr

Java: Ninepatch for Java

April 1, 2012 2 comments

I came upon this interesting project [1] that allows you to draw nine patch images using Java Graphics2D. Therefor, this project allows you to use your android’s nine patch images when drawing on an Applet or Frame in Java.


import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JApplet;

import util.NinePatch;

public class AplletScene extends JApplet {
	private static final long serialVersionUID = 1L;
	private NinePatch npatch;

	public AplletScene() {


	public void init() {

		BufferedImage img2 = null;
		try {
			img2 = ImageIO.read(new File("/path/to/ninepatch.9.png"));
		} catch (IOException e) {

		npatch = NinePatch.load(img2, true, false);

	public void paint(Graphics g) {
		Graphics2D gg = (Graphics2D) g;
		npatch.draw(gg, 0, 0, 600, 600);


[1] http://source-android.frandroid.com/sdk/ninepatch/src/com/android/ninepatch/

Categories: Java

Android: Using OpenGL for 2D rendering – the easy way

March 25, 2012 3 comments

This is an extension to the project developed by Chris Pruett, which can be found here [1]. Feel free to read the README provided.


Basically, what this project aims to do is to offer you a simple class that can be used to render 2D objects in an OpenGL surface.

I modified a little the project written by Chris Pruett by adding a wrapper class corresponding to a scene. This allows you to use OpenGL very easily in order to render 2D objects. You can instantiate this class, add various sprites and have them drawn on the surface view.

The project can be downloaded here [2].

This is the API for the Scene class:

public interface Scene {
	public SurfaceView getSurfaceView();

	 * Sets a bitmap as the background
	 * @param bitmap
	public void setBitmapBackground(Bitmap bitmap);

	 * Sets a nine patch resource as the background. It will stretch to fill the
	 * entire screen. When screen orientation will change, this background will
	 * also change to fill the new screen.
	 * @param pictureId
	public void setNinePatchBackground(int pictureId);

	 * Sets the background color of the scene. No bitmap will be used any more
	 * for the background.
	 * @param color
	public void setBackgroundColor(CustomColor color);

	 * Adds a sprite to the scene.
	 * @param sprite
	 * @param addToMover
	 *            Whether to pass this to the Mover thread
	public void addSprite(GLSprite sprite, boolean addToMover);

	 * Sets the mover thread. This will handle the sprites' movement.
	 * @param mover
	public void setMover(Mover mover);

	 * Creates a sprite corresponding to the given resource id
	 * @param context
	 * @param resourceId
	 * @return
	public Renderable createSprite(Context context, int resourceId);

	 * Returns a sprite corresponding to a given bitmap
	 * @param bitmap
	 *            The bitmap used for the sprite
	 * @param bitmapId
	 *            The bitmap id is used to re-use textures (use same ID for same
	 *            bitmaps content)
	 * @return
	public Renderable createSprite(Bitmap bitmap, int bitmapId);



public class MainActivity extends Activity {
	public void onCreate(Bundle savedInstanceState) {

		Scene scene = createScene();

	private Scene createScene() {
		// our OpenGL scene
		GLScene scene = new GLScene(this);

		// can set a nine patch for the background

		// can set a bitmap for the background
		// scene.setBitmapBackground(someBitmap);

		// can set a color for the background
		// scene.setBackgroundColor(new CustomColor(0, 0, 0, 1));

		// create some sprites
		GLSprite sprite = scene.createSprite(getApplicationContext(), R.drawable.skate1);
		// initial position
		sprite.x = 100;
		sprite.y = 200;
		GLSprite sprite2 = scene.createSprite(getApplicationContext(), R.drawable.skate2);
		// initial position
		sprite2.x = 300;
		sprite2.y = 400;

		// add sprites to the scene
		scene.addSprite(sprite, true);
		scene.addSprite(sprite2, true);
		scene.addSprite(sprite.clone(), true);
		scene.addSprite(sprite2.clone(), true);

		// this thread controls the sprites' positions
		scene.setMover(new Mover());
		return scene;

GL 2D scene preview

[1] http://code.google.com/p/apps-for-android/source/browse/SpriteMethodTest/
[2] https://github.com/costimuraru/Simple-Android-OpenGL-2D-Rendering

Categories: Android

Android: [RO] Lansat Bancuri v1.1

February 13, 2012 Leave a comment


  1. Erorile din versiunea precedenta au fost rezolvate.
  2. Widget – Puteti să adăugati pe homescreen widgetul Bancuri. Astfel veti avea acces direct de acolo la cele mai amuzante glume.
  3. Facebook – Puteti acum să partajati pe Facebook bancurile sau imaginile care v-au amuzat.
  4. O nouă categorie numită “Poze” a fost introdusă. Aici puteti vedea diverse poze amuzante, sortate dupa cum doriti.
  5. Poze în format mare – Puteti vedea imaginile în format mai mare, de asemenea puteti da zoom pe ele.


Citeste ultimele bancuri adaugate zilnic de catre oameni de pretutindeni. Imagini amuzante te asteapta sa iti ofere si ele un zambet.


Categories: Uncategorized

Bash: Multiple expressions inside an if statement

February 10, 2012 Leave a comment

Quick tip for someone trying to include multiple expressions inside an if statement under Bash.

Java like:

if (a = 0 || >= 10 && b <= 20)
// ok



if [ $a = 40 -o $b -ge 10 -a $b -le 20 ]; then
echo "If passed"
Categories: Uncategorized

Android: View SQLite table contents

December 21, 2011 Leave a comment

I am going to present to you a simple way of visualizing and interacting with a copy of a SQLite database belonging to your Android application.

– Eclipse
– SQLite browser – (http://sourceforge.net/projects/sqlitebrowser/ or any other SQLite browser)

After you have  installed your application and you have created some database(s) and inserted some entries, a database file will be created to the android device/emulator. The first step is to retrieve this file. Please note that in order to retrieve this file from an Android device, you’ll need to be root. If that is not possible, please run on an emulator.

In Eclipse go to Window -> Show View -> Other… -> Android -> File Explorer.
Then go to /data/data. Here you can see a list of  all the apps. Choose your desired app. It should have a “databases” folder. Here you will see all your created databases.

In order to copy this file using Eclipse search for an option (inside the File Explorer window) called “Pull a file from device”.

Now you should have copied the *.db file on your computer. Use the SQLite browser to look through the database and even make queries.

Good luck!

Categories: Uncategorized