Pages

Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Friday, May 6, 2016

Install Android Studio on Ubuntu 15 10 using ubuntu developer tools center


remark:
ubuntu-developer-tools-center is now named Ubuntu Make officially.
Please check the updated "Install Android Studio on 64-bit Ubuntu-GNOME 15.10 with Ubuntu Make".



To install Android Studio on Ubuntu 15.10 using ubuntu-developer-tools-center
- install java (refer "Install Oracle java8 on Ubuntu 15.10 via PPA")
- Enter the command in Terminal:
$ sudo apt-get install ubuntu-developer-tools-center
$ udtc android

This video show installing Android Studio on 64-bit Ubuntu 15.10 (run in VirtualBox) using ubuntu-developer-tools-center.

Read More..

Saturday, April 30, 2016

Setup Hardware Devices debugging for Android Studio on Ubuntu 15 10

This video show how to setup /etc/udev/rules.d/51-android.rules in Ubuntu (behind VirtualBox) to enable hardware device debugging in Android Studio.


The development platform is 64-bit Ubuntu-GNOME 15.10 running in VirtualBox, with Android Studio installed with Ubuntu Make (umake).

To enable hardware device debugging in Ubuntu, you have to create /etc/udev/rules.d/51-android.rules file to add device IDs for your debugging devices. (refer: Android Developers Document Using Hardware Devices - Setting up a Device for Development)

Create /etc/udev/rules.d/51-android.rules file with sudo right, add the line and save:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
where "18d1" is the USB Vendor ID for Google, Nexus 7 in my case.

Run the command:
$ sudo chmod a+r /etc/udev/rules.d/51-android.rules

This video show how to, behind VirtualBox.

Read More..

Thursday, March 31, 2016

Install Android Studio on 64 bit Ubuntu 15 10 with Ubuntu Make umake

Ubuntu Make is a command line tool which allows you to download the latest version of popular developer tools (include Android Studio) on your installation, installing it longside all the required dependencies (which will only ask for root access if you dont have all the required dependencies installed already), enable multi-arch on your system if you are on a 64 bit machine, integrate it with the Unity launcher… Basically, one command to get your system ready to develop with!


To install Android Studio on Ubuntu:

- Add the Ubuntu Make ppa:
$ sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
$ sudo apt-get update

- Install Ubuntu Make:
$ sudo apt-get install ubuntu-make

- Install android-studio:
$ umake android

Once finished, it will also install Java 7 (1.7.0_85 currently) on your system.

This video show how to install Android Studio on 64-bit Ubuntu-GNOME (run on VirtualBox) with Ubuntu Make.


Next:
- Setup Hardware Devices debugging for Android Studio on Ubuntu 15.10

Read More..

Wednesday, March 16, 2016

Install Android Studio 2 0 Preview on Ubuntu Linux parallel with existing installed Android Studio


Android Studio 2.0 Preview is available to download in Canary Channel now. This video show how to download and run in Ubuntu (Ubuntu-GNOME 15.10 on VirtualBox/Windows 10), in parallel with existing installed Android Studio 1.5.


(reference: Android Developers Blog)

Related:
- Download and run Android Studio 2.0 Preview on Windows 10

Read More..

Monday, February 29, 2016

Android example code using ColorFilter



MainActivity.java
package com.blogspot.android_er.androidcolorfilter;

import android.graphics.ColorFilter;
import android.graphics.ColorMatrixColorFilter;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.SeekBar;

public class MainActivity extends AppCompatActivity {

ImageView imageView;
SeekBar redBar, greenBar, blueBar;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

imageView = (ImageView)findViewById(R.id.iv);
redBar = (SeekBar)findViewById(R.id.redbar);
greenBar = (SeekBar)findViewById(R.id.greenbar);
blueBar = (SeekBar)findViewById(R.id.bluebar);

redBar.setOnSeekBarChangeListener(colorBarChangeListener);
greenBar.setOnSeekBarChangeListener(colorBarChangeListener);
blueBar.setOnSeekBarChangeListener(colorBarChangeListener);

setColorFilter(imageView);
}

SeekBar.OnSeekBarChangeListener colorBarChangeListener
= new SeekBar.OnSeekBarChangeListener(){

@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
setColorFilter(imageView);
}

@Override
public void onStartTrackingTouch(SeekBar seekBar) {

}

@Override
public void onStopTrackingTouch(SeekBar seekBar) {

}
};

private void setColorFilter(ImageView iv){

/*
* 5x4 matrix for transforming the color+alpha components of a Bitmap.
* The matrix is stored in a single array, and its treated as follows:
* [ a, b, c, d, e,
* f, g, h, i, j,
* k, l, m, n, o,
* p, q, r, s, t ]
*
* When applied to a color [r, g, b, a], the resulting color is computed
* as (after clamping)
* R = a*R + b*G + c*B + d*A + e;
* G = f*R + g*G + h*B + i*A + j;
* B = k*R + l*G + m*B + n*A + o;
* A = p*R + q*G + r*B + s*A + t;
*/

float redValue = ((float)redBar.getProgress())/255;
float greenValue = ((float)greenBar.getProgress())/255;
float blueValue = ((float)blueBar.getProgress())/255;

float[] colorMatrix = {
redValue, 0, 0, 0, 0, //red
0, greenValue, 0, 0, 0, //green
0, 0, blueValue, 0, 0, //blue
0, 0, 0, 1, 0 //alpha
};

ColorFilter colorFilter = new ColorMatrixColorFilter(colorMatrix);
iv.setColorFilter(colorFilter);
}

}


layout/activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout


android_layout_width="match_parent"
android_layout_height="match_parent"
android_padding="16dp"
android_orientation="vertical"
tools_context=".MainActivity">

<TextView
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_layout_gravity="center_horizontal"
android_autoLink="web"
android_text="http://android-er.blogspot.com/"
android_textStyle="bold" />

<ImageView
android_id="@+id/iv"
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_src="@mipmap/ic_launcher"/>

<SeekBar
android_id="@+id/redbar"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_max="255"
android_progress="255"/>
<SeekBar
android_id="@+id/greenbar"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_max="255"
android_progress="255"/>
<SeekBar
android_id="@+id/bluebar"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_max="255"
android_progress="255"/>
</LinearLayout>


Related:
- Convert ImageView to black and white, and set brightness, using ColorFilter

Read More..

Thursday, February 25, 2016

Download and run Android Studio 2 0 Preview on Windows 10


This video show how to download and run Android Studio 2.0 Preview from Canary Channel?, in parallel with existing installed Android Studio 1.5.
(The Emulator is seem still the old version, not the New Android Emulator)

reference: Android Developers Blog announcement


Related: Install Android Studio 2.0 Preview on Ubuntu Linux, parallel with existing installed Android Studio


Read More..

Saturday, February 13, 2016

Doing More with Java Android and Tomcat Edition

Doing More with Java: Android and Tomcat Edition

This Doing More With book helps you move from introductory Java to more powerful tools and concepts. As you go through the book you get to where you can connect an Android app to a Hibernate/Tomcat server. Unlike many programming books, this one helps you gain all the skills to create mobile connected apps. Using HTTP from Android with JSON, Hibernate, and MySQL a complete JSON Web Service can be created and consumed.

The tone of the book is intended to be light rather than pedantic and hints and tips based on the author’s life experience are included.

Read More..