I need a Linux box for work development (Mac Unix does not suffice) so I downloaded VirtualBox and Ubuntu. To start developing I needed a bunch of installed.
VirtualBox Ubuntu: setup for development
find similar posts:
Linux/Unix,
Ubuntu,
VirtualBox
0
comments
VirtualBox Ubuntu: setup for development
I need a Linux box for work development (Mac Unix does not suffice) so I downloaded VirtualBox and Ubuntu. To start developing I needed a bunch of installed.
Installing Java JDK
$ sudo apt-get -y install default-jdk
Install ANT
sudo apt-get -u install ant
Install GIT
sudo apt-get install git
Installing Misc tools
sudo apt-get install build-essential
Download the package lists from the repositories. This is not update of tools, just the available directory. Upgrade existing packages.
Install Guest Additions
Top menu > Devices > Insert Guest Additions CD...
cd /media/uki/VBOXADDITIONS_4.3.16_95972/
sudo apt-get update&&sudo apt-get dist-upgrade
Install Guest Additions
Top menu > Devices > Insert Guest Additions CD...
cd /media/uki/VBOXADDITIONS_4.3.16_95972/
sudo ./VBoxLinuxAdditions.run
Installing Java JDK
$ sudo apt-get -y install default-jdk
$ java -version
java version "1.7.0_65"
Install ANT
sudo apt-get -u install ant
$ ant -v
Apache Ant(TM) version 1.9.3 compiled on April 8 2014
Install GIT
sudo apt-get install git
$ git version
git version 1.9.1
Installing Misc tools
sudo apt-get install build-essential
sudo apt-get -y install autoconf automake
apt-get -y install curl
apt-get -y install libtool
find similar posts:
Linux/Unix,
Ubuntu,
VirtualBox
0
comments
VItrualBox Ubuntu on Mac: up/down/delete keys act weird typing letters
When I try to navigate in vi editor the characters are being typed instead.
find similar posts:
Ubuntu,
VirtualBox
0
comments
VItrualBox Ubuntu on Mac: up/down/delete keys act weird typing letters
When I try to navigate in vi editor the characters are being typed instead.
You can get by you alternating fn and control while using up/down and delete buttons, but that is very frustrating and hard to remember.
Solution:
in Terminal >
You can get by you alternating fn and control while using up/down and delete buttons, but that is very frustrating and hard to remember.
Solution:
in Terminal >
vi ~/.vimrc
add following line:set nocompatible
Note: In case you don't remember how to use vi:
- hit "i" for INSERT mode
- hit "esc" ":wq"and "enter" to save
- hit "esc" ":q!" to leave without saving
- hit "esc" ":wq"and "enter" to save
- hit "esc" ":q!" to leave without saving
find similar posts:
Ubuntu,
VirtualBox
0
comments
Eclipse: hiding files in Package Explorer
It is very important to have your Eclipse IDE as optimized as possible. It is essential for me to see all "hidden" files and directories such as .gitmodules, .project, .classpath, but I do not want to see .DS_store as it is useless to me.
find similar posts:
Eclipse,
Mac
0
comments
Eclipse: hiding files in Package Explorer
It is very important to have your Eclipse IDE as optimized as possible. It is essential for me to see all "hidden" files and directories such as .gitmodules, .project, .classpath, but I do not want to see .DS_store as it is useless to me.
Solution:
In your Eclipse > Package Explorer > click a small triangle drop-down > Filters..
Add ".DS_store" and any other file patterns comma separated.
Press OK to save.
Solution:
In your Eclipse > Package Explorer > click a small triangle drop-down > Filters..
Add ".DS_store" and any other file patterns comma separated.
Press OK to save.
find similar posts:
Eclipse,
macOS
0
comments
GIT: remove last (few) commits
You should commit often, however sometimes I do a NEW commit instead making an amend to previous, that is especially important when working with tools like Gerit (online code review) when you can have only 1 commit, sometimes for a very long time.
This recipe works only if you did NOT PUSH.
find similar posts:
git
0
comments
GIT: remove last (few) commits
You should commit often, however sometimes I do a NEW commit instead making an amend to previous, that is especially important when working with tools like Gerit (online code review) when you can have only 1 commit, sometimes for a very long time.
This recipe works only if you did NOT PUSH.
Remove recent X (~1) commits without destroying your local changes:
git loggit reset --soft HEAD~1
at this time you can squash your multiple commits and commit with --amend flag.
$ git status $ git add --all$ git commit --amend
find similar posts:
git
0
comments
GIT: update ALL REPOS in current directory
If you have a ZILLION GIT repositories in your current workspace you may benefit from a Bash shell command that does operations on all of them at one swoop.
find similar posts:
Bash,
git,
Linux/Unix
0
comments
GIT: update ALL REPOS in current directory
If you have a ZILLION GIT repositories in your current workspace you may benefit from a Bash shell command that does operations on all of them at one swoop.
function git_all_REPOS_in_current_directory() {
function git_all_REPOS_in_current_directory() {
WORKING_DIR=$PWD
for DIRECTORY in ls -d */
do
#echo "directory: $DIRECTORY"
cd $WORKING_DIR/$DIRECTORY
pwd
git fetch
# do more as need like git rebase, etc. I prefer to do it MANUALLY
# get modules up to date
git submodule foreach git fetch
git submodule foreach git rebase
done
}
find similar posts:
Bash,
git,
Linux/Unix
0
comments
Eclipse: converting Android to plain Java project
When you are switching between Android and plain Java projects (or libraries) occasionally you may end up with a Java project that is complaining: AndroidManifest.xml is missing!
This tutorial shows the steps to fix that.
This tutorial shows the steps to fix that.
Step 1) Open .properties and remove line with AndroidNature
<natures><nature>com.android.ide.eclipse.adt.AndroidNature</nature><nature>org.eclipse.jdt.core.javanature</nature></natures>
Step 2) remove Android specific buildSpec
<buildSpec><buildCommand><name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name><arguments></arguments></buildCommand><buildCommand><name>com.android.ide.eclipse.adt.PreCompilerBuilder</name><arguments></arguments></buildCommand><buildCommand><name>org.eclipse.jdt.core.javabuilder</name><arguments></arguments></buildCommand><buildCommand><name>com.android.ide.eclipse.adt.ApkBuilder</name><arguments></arguments></buildCommand></buildSpec>
Step 3) Open .classpath and remove android references
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
Step 3) Open project.properties (auto-generated) and remove Android references
android.library=true
# Project target.
target=android-17
Step 4) Open .settings/org.eclipse.jdk.core.pref the file should look like that
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
Step 4) Clean and rebuild the project
find similar posts:
Android,
Eclipse,
Java
0
comments
Eclipse: converting Android to plain Java project
When you are switching between Android and plain Java projects (or libraries) occasionally you may end up with a Java project that is complaining: AndroidManifest.xml is missing!
This tutorial shows the steps to fix that.
This tutorial shows the steps to fix that.
find similar posts:
Android,
Eclipse,
Java
0
comments
5b. Android: formatting numbers based on LOCALE
This example shows you how to format a number based on user's language and region setting (LOCALE)
find similar posts:
Android,
Localization
0
comments
5b. Android: formatting numbers based on LOCALE
This example shows you how to format a number based on user's language and region setting (LOCALE)
/**
* This method updates the UI with LOCALE specific format
* e.g. US 1,234.99
* e.g. Europe 1 234,99
* @param resultingValue - calculated value to be displayed
*/
private void updateResult(double resultingValue) {
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(2);
nf.setMinimumFractionDigits(0);
resultingValueTextView.setText(nf.format(resultingValue));
}
/**
* This method updates the UI with LOCALE specific format
* e.g. US 1,234.99
* e.g. Europe 1 234,99
* @param resultingValue - calculated value to be displayed
*/
private void updateResult(double resultingValue) {
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(2);
nf.setMinimumFractionDigits(0);
resultingValueTextView.setText(nf.format(resultingValue));
}
find similar posts:
Android,
Localization
0
comments
Android Studio: Reveal in Finder
Very often you need to open the file or a directory in Finder (or Terminal), to do so you right-click on the file or directory and selected Reveal In Finder.
find similar posts:
Android Studio,
Finder
0
comments
Android Studio: Reveal in Finder
Very often you need to open the file or a directory in Finder (or Terminal), to do so you right-click on the file or directory and selected Reveal In Finder.
find similar posts:
Android Studio,
Finder
0
comments
5a. Android Studio: create new Java CONSTANTS class
Sometimes is worth to extract a bunch of code to a separate class to keep the original short and sweet (readable and maintainable).
find similar posts:
Android Studio,
IDE,
Java
0
comments
5a. Android Studio: create new Java CONSTANTS class
Sometimes is worth to extract a bunch of code to a separate class to keep the original short and sweet (readable and maintainable).
In our Activity class I had a lot of constants:
private final static double CONVERSION_METERS_TO_YARDS = 1.093613298;
One way to maintain them was to move them to a new Java class ConversionConstants
package com.chicagoandroid.cit299.calc;
In our Activity class I had a lot of constants:
private final static double CONVERSION_METERS_TO_YARDS = 1.093613298;
private final static double CONVERSION_KILOMETERS_TO_MILES = 0.621371192;
One way to maintain them was to move them to a new Java class ConversionConstants
- Make sure you write the JavaDoc /** my description */ for each class you create
- constants are public - available form any other class
- constants are final - the value cannot be changed by the code
- constants are static - indicate that the constant will belong to class and not the instance, you don't have to have an instance to get it e.g. ConversionConstants.METERS_TO_YARDS
package com.chicagoandroid.cit299.calc;
/**
* This class will contain hundreds of possible conversion constants.
*/
public class ConversionConstants {
public final static double METERS_TO_YARDS = 1.093613298;
public final static double KILOMETERS_TO_MILES = 0.621371192;
}
Now I can access these constants from any other class and use them in my calculations:
Note: I am not providing the source code on purpose because copy-and-paste is not a good learning experience.
find similar posts:
Android Studio,
IDE,
Java
0
comments
Eclipse: starting from bash command line
I start Eclipse from Bash command line (in Terminal.app) to make sure it reads all Bash Enviroment settings.
function eclipse () {
nohup bash -ic /Eclipse_Luna_4_4/Eclipse.app/Contents/MacOS/eclipse &
echo "disown PID -- prevent eclipse from closing when you close Terminal"
}
function eclipse () {
nohup bash -ic /Eclipse_Luna_4_4/Eclipse.app/Contents/MacOS/eclipse &
echo "disown PID -- prevent eclipse from closing when you close Terminal"
}
find similar posts:
Eclipse,
Terminal
0
comments
Eclipse: starting from bash command line
I start Eclipse from Bash command line (in Terminal.app) to make sure it reads all Bash Enviroment settings.
function eclipse () {
nohup bash -ic /Eclipse_Luna_4_4/Eclipse.app/Contents/MacOS/eclipse &
echo "disown PID -- prevent eclipse from closing when you close Terminal"
}
function eclipse () {
nohup bash -ic /Eclipse_Luna_4_4/Eclipse.app/Contents/MacOS/eclipse &
echo "disown PID -- prevent eclipse from closing when you close Terminal"
}
find similar posts:
Eclipse,
Terminal
0
comments
4i. Android: 9patch
If you want to provide a reach UI you will be using images, it is not possible to create image for every device size, therefore they will be stretching. Android 9patch is a way to control what can stretch in the image to preserve quality of that image.
Examples of using 9patch:
Finding draw9patch tool
Examples of using 9patch:
Finding draw9patch tool
In the browser search for square icon
- top - stretch horizontally
- left - stretch vertically
- right - content area
- bottom - content area
Actual look of the 9patch:
Copy your 9patch pop_up_background_82x82.9.png to drawable folder:
conventer/src/main/res/drawable-mdpi/pop_up_background.9.png
<TextView
android:id="@+id/resultingValue"
android:text="..."
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="60"
android:background="@drawable/pop_up_background" />
find similar posts:
Android,
draw9patch
0
comments
4i. Android: 9patch
If you want to provide a reach UI you will be using images, it is not possible to create image for every device size, therefore they will be stretching. Android 9patch is a way to control what can stretch in the image to preserve quality of that image.
Examples of using 9patch:
Finding draw9patch tool
Examples of using 9patch:
Finding draw9patch tool
In the browser search for square icon
- top - stretch horizontally
- left - stretch vertically
- right - content area
- bottom - content area
Actual look of the 9patch:
Copy your 9patch pop_up_background_82x82.9.png to drawable folder:
conventer/src/main/res/drawable-mdpi/pop_up_background.9.png
<TextView
android:id="@+id/resultingValue"
android:text="..."
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="60"
android:background="@drawable/pop_up_background" />
find similar posts:
Android,
draw9patch
0
comments
4h. Android: Activity lifecycle methods
There are few concepts that you will have to get familiar with:
/**
/** Activity is obstructed, stop updating the views */
There is a description available on from Google's Android Developers site:
http://developer.android.com/reference/android/app/Activity.html
It takes time and effort to create tutorials, please support my efforts with a couple-dollar donation, any amount will be greatly appreciated and highly motivating!
- activity stack - LIFO (last in, first out )
- active activity - running activity that is visible and interactive
- paused activity - running activity that is visible, but obstructed
- stopped activity - completely obstructed
- inactivate activity - app has been killed by Android, or the user
/**
* Activity starts but it is not visible yet, open necessary connections
*/
protected void onCreate(Bundle savedInstanceState) {
super.onStart();
// your code
}
/**
* Activity starts but it is not visible yet, open necessary connections
*/
protected void onStart() {
super.onStart();
// your code
}
/**
* activity was completely hidden by another Activity, or another app, but not killed
* check if you need refresh time-sensitive content (facebook wall update)
*/
protected void onRestart() {
super.onRestart();
// your code
}
/**
* Activity is now visible to the user, resume updating the views
*/
protected void onResume() {
super.onResume();
// your code
}
/** Activity is obstructed, stop updating the views */
protected void onPause() {
super.onPause();
// your code
}
/**
* Activity was obstructed, release resources, or it may get killed
*/
protected void onStop() {
super.onStop();
// your code
}
/**
* Activity is being killed by Android, close network and database connections
*/
protected void onDestroy() {
super.onDestroy();
// your code
}
There is a description available on from Google's Android Developers site:
http://developer.android.com/reference/android/app/Activity.html
It takes time and effort to create tutorials, please support my efforts with a couple-dollar donation, any amount will be greatly appreciated and highly motivating!
find similar posts:
Activity,
Android
0
comments
4h. Android: Activity lifecycle methods
There are few concepts that you will have to get familiar with:
/**
/** Activity is obstructed, stop updating the views */
There is a description available on from Google's Android Developers site:
http://developer.android.com/reference/android/app/Activity.html
It takes time and effort to create tutorials, please support my efforts with a couple-dollar donation, any amount will be greatly appreciated and highly motivating!
- activity stack - LIFO (last in, first out )
- active activity - running activity that is visible and interactive
- paused activity - running activity that is visible, but obstructed
- stopped activity - completely obstructed
- inactivate activity - app has been killed by Android, or the user
/**
* Activity starts but it is not visible yet, open necessary connections
*/
protected void onCreate(Bundle savedInstanceState) {
super.onStart();
// your code
}
/**
* Activity starts but it is not visible yet, open necessary connections
*/
protected void onStart() {
super.onStart();
// your code
}
/**
* activity was completely hidden by another Activity, or another app, but not killed
* check if you need refresh time-sensitive content (facebook wall update)
*/
protected void onRestart() {
super.onRestart();
// your code
}
/**
* Activity is now visible to the user, resume updating the views
*/
protected void onResume() {
super.onResume();
// your code
}
/** Activity is obstructed, stop updating the views */
protected void onPause() {
super.onPause();
// your code
}
/**
* Activity was obstructed, release resources, or it may get killed
*/
protected void onStop() {
super.onStop();
// your code
}
/**
* Activity is being killed by Android, close network and database connections
*/
protected void onDestroy() {
super.onDestroy();
// your code
}
There is a description available on from Google's Android Developers site:
http://developer.android.com/reference/android/app/Activity.html
It takes time and effort to create tutorials, please support my efforts with a couple-dollar donation, any amount will be greatly appreciated and highly motivating!
find similar posts:
Activity,
Android
0
comments
Android: language locale
Android allows us to write applications that are specific to languages and regions.
Don't forget to provide translations for regional varieties of the language!
<resources>
- create locale specific layouts if language has different layout than default (i.e. Chinese)
- create local specific res/values/strings.xml for each language you want to support
- create local specific res/values/dimens.xml if language requires some minor length adjustments (e.g. German)
Don't forget to provide translations for regional varieties of the language!
<resources>
<string name="app_name">Converter Mate!</string>
<string name="select_conversion">Select Conversion Mate!:</string>
<string name="enter_value">Enter Value Mate!</string>
<string name="action_settings">Settings Mate!</string>
<string name="resulting_value">Resulting Value Mate!:</string>
find similar posts:
Android,
Android Resources
0
comments
Android: language locale
Android allows us to write applications that are specific to languages and regions.
Don't forget to provide translations for regional varieties of the language!
<resources>
- create locale specific layouts if language has different layout than default (i.e. Chinese)
- create local specific res/values/strings.xml for each language you want to support
- create local specific res/values/dimens.xml if language requires some minor length adjustments (e.g. German)
Don't forget to provide translations for regional varieties of the language!
<resources>
<string name="app_name">Converter Mate!</string>
<string name="select_conversion">Select Conversion Mate!:</string>
<string name="enter_value">Enter Value Mate!</string>
<string name="action_settings">Settings Mate!</string>
<string name="resulting_value">Resulting Value Mate!:</string>
find similar posts:
Android,
Android Resources
0
comments
Android: switch case conditional
At some point, each application will have to perform some logic based on different cases.
private final static double CONVERSION_METERS_TO_YARDS = 1.093613298;
private final static double CONVERSION_KILOMETERS_TO_MILES = 0.621371192;
private void calculateResult() {
Double valueEntered = 0.0;
try {
valueEntered = Double.valueOf(valueEnteredEditText.getText().toString());
showToast("afterTextChanged " + valueEntered);
}
catch (NumberFormatException e) {
resultingValueTextView.setText("");
return;
}
switch (selectedConversion) {
case 0:
resultingValueTextView.setText("" + valueEntered * CONVERSION_METERS_TO_YARDS);
break;
case 1:
resultingValueTextView.setText("" + valueEntered * CONVERSION_KILOMETERS_TO_MILES);
break;
}
}
- extract your CONSTANTS
- extract your logic into a separate method so it can be called from several places
- use switch case instead of if else
- use try catch statement when data types may vary
private final static double CONVERSION_METERS_TO_YARDS = 1.093613298;
private final static double CONVERSION_KILOMETERS_TO_MILES = 0.621371192;
private void calculateResult() {
Double valueEntered = 0.0;
try {
valueEntered = Double.valueOf(valueEnteredEditText.getText().toString());
showToast("afterTextChanged " + valueEntered);
}
catch (NumberFormatException e) {
resultingValueTextView.setText("");
return;
}
switch (selectedConversion) {
case 0:
resultingValueTextView.setText("" + valueEntered * CONVERSION_METERS_TO_YARDS);
break;
case 1:
resultingValueTextView.setText("" + valueEntered * CONVERSION_KILOMETERS_TO_MILES);
break;
}
}
find similar posts:
Android,
Java
0
comments
Android: switch case conditional
At some point, each application will have to perform some logic based on different cases.
private final static double CONVERSION_METERS_TO_YARDS = 1.093613298;
private final static double CONVERSION_KILOMETERS_TO_MILES = 0.621371192;
private void calculateResult() {
Double valueEntered = 0.0;
try {
valueEntered = Double.valueOf(valueEnteredEditText.getText().toString());
showToast("afterTextChanged " + valueEntered);
}
catch (NumberFormatException e) {
resultingValueTextView.setText("");
return;
}
switch (selectedConversion) {
case 0:
resultingValueTextView.setText("" + valueEntered * CONVERSION_METERS_TO_YARDS);
break;
case 1:
resultingValueTextView.setText("" + valueEntered * CONVERSION_KILOMETERS_TO_MILES);
break;
}
}
- extract your CONSTANTS
- extract your logic into a separate method so it can be called from several places
- use switch case instead of if else
- use try catch statement when data types may vary
private final static double CONVERSION_METERS_TO_YARDS = 1.093613298;
private final static double CONVERSION_KILOMETERS_TO_MILES = 0.621371192;
private void calculateResult() {
Double valueEntered = 0.0;
try {
valueEntered = Double.valueOf(valueEnteredEditText.getText().toString());
showToast("afterTextChanged " + valueEntered);
}
catch (NumberFormatException e) {
resultingValueTextView.setText("");
return;
}
switch (selectedConversion) {
case 0:
resultingValueTextView.setText("" + valueEntered * CONVERSION_METERS_TO_YARDS);
break;
case 1:
resultingValueTextView.setText("" + valueEntered * CONVERSION_KILOMETERS_TO_MILES);
break;
}
}
find similar posts:
Android,
Java
0
comments
Android: LinearLayout
I like to work with combination of LinearLayout, especially when creating forms.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context=".MainActivity">
<LinearLayout
android:id="@+id/spinnerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/select_conversion"
android:layout_weight="40" />
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/conversionSelectorSpinner"
android:layout_weight="60" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:text="@string/enter_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="40" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="8"
android:id="@+id/valueEntered"
android:onClick="onClickEnterValue"
android:text=""
android:layout_gravity="center_vertical"
android:layout_weight="60" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="30dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:text="@string/resulting_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="40" />
<TextView
android:id="@+id/resultingValue"
android:text="..."
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="60" />
</LinearLayout>
</LinearLayout>
find similar posts:
Android,
LinearLayout
0
comments
Android: LinearLayout
I like to work with combination of LinearLayout, especially when creating forms.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context=".MainActivity">
<LinearLayout
android:id="@+id/spinnerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/select_conversion"
android:layout_weight="40" />
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/conversionSelectorSpinner"
android:layout_weight="60" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:text="@string/enter_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="40" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="8"
android:id="@+id/valueEntered"
android:onClick="onClickEnterValue"
android:text=""
android:layout_gravity="center_vertical"
android:layout_weight="60" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="30dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:text="@string/resulting_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="40" />
<TextView
android:id="@+id/resultingValue"
android:text="..."
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="60" />
</LinearLayout>
</LinearLayout>
find similar posts:
Android,
LinearLayout
0
comments
Android: handling input fo TextEdit and updating TextView
Some of the simplest, but very useful apps, can contain forms that that you have to read and fill out. You can do most of that work with TextEdit (input) and TextView (output).
Step 1) Define your layout, name your widgets very well.
Step 2) Define class members for each of the fields that will be used multiple times
public class MainActivity extends ActionBarActivity {
Step 3) Find the right layout items by ID and inflate them.
@Override
Step 4) Add a listener that will react to a value entered
Step 1) Define your layout, name your widgets very well.
Step 2) Define class members for each of the fields that will be used multiple times
public class MainActivity extends ActionBarActivity {
//during the life-span of the app we will access these fields many times
private EditText valueEnteredEditText;
private TextView resultingValueTextView;
Step 3) Find the right layout items by ID and inflate them.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
valueEnteredEditText = (EditText) findViewById(R.id.valueEntered);
resultingValueTextView = (TextView) findViewById(R.id.resultingValue);
addListenerToValueEnteredEditText();
createConversionSelectorSpinner();
}
Step 4) Add a listener that will react to a value entered
private void addListenerToValueEnteredEditText() {
valueEnteredEditText.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
showToast("onTextChanged ");
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
showToast("beforeTextChanged ");
}
public void afterTextChanged(Editable s) {
calculateResult();
}
});
}
Android: handling input fo TextEdit and updating TextView
Some of the simplest, but very useful apps, can contain forms that that you have to read and fill out. You can do most of that work with TextEdit (input) and TextView (output).
Step 1) Define your layout, name your widgets very well.
Step 2) Define class members for each of the fields that will be used multiple times
public class MainActivity extends ActionBarActivity {
Step 3) Find the right layout items by ID and inflate them.
@Override
Step 4) Add a listener that will react to a value entered
Step 1) Define your layout, name your widgets very well.
Step 2) Define class members for each of the fields that will be used multiple times
public class MainActivity extends ActionBarActivity {
//during the life-span of the app we will access these fields many times
private EditText valueEnteredEditText;
private TextView resultingValueTextView;
Step 3) Find the right layout items by ID and inflate them.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
valueEnteredEditText = (EditText) findViewById(R.id.valueEntered);
resultingValueTextView = (TextView) findViewById(R.id.resultingValue);
addListenerToValueEnteredEditText();
createConversionSelectorSpinner();
}
Step 4) Add a listener that will react to a value entered
private void addListenerToValueEnteredEditText() {
valueEnteredEditText.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
showToast("onTextChanged ");
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
showToast("beforeTextChanged ");
}
public void afterTextChanged(Editable s) {
calculateResult();
}
});
}
Android Studio: switching between Project and Structure views
If you have a lot of methods in a given class you may want to see the Structure view.
Step 1) Select "monitor" icon in the bottom-left corner
Step 2) Select "Structure" view
Step 3) Open view settings "gear" icon
Step 4) Sort Alphabetically
Step 5) Autoscroll to Source - if you select any method on the left, the right source will show
Step 6) Autoscroll from Source - if you select in the source, the method on the left will be selected
Step 1) Select "monitor" icon in the bottom-left corner
Step 2) Select "Structure" view
Step 3) Open view settings "gear" icon
Step 4) Sort Alphabetically
Step 5) Autoscroll to Source - if you select any method on the left, the right source will show
Step 6) Autoscroll from Source - if you select in the source, the method on the left will be selected
find similar posts:
Android Studio
0
comments
Android Studio: switching between Project and Structure views
If you have a lot of methods in a given class you may want to see the Structure view.
Step 1) Select "monitor" icon in the bottom-left corner
Step 2) Select "Structure" view
Step 3) Open view settings "gear" icon
Step 4) Sort Alphabetically
Step 5) Autoscroll to Source - if you select any method on the left, the right source will show
Step 6) Autoscroll from Source - if you select in the source, the method on the left will be selected
Step 1) Select "monitor" icon in the bottom-left corner
Step 2) Select "Structure" view
Step 3) Open view settings "gear" icon
Step 4) Sort Alphabetically
Step 5) Autoscroll to Source - if you select any method on the left, the right source will show
Step 6) Autoscroll from Source - if you select in the source, the method on the left will be selected
find similar posts:
Android Studio
0
comments
Android: adding a Spinner (drop-down or pick-list widget)
You start by adding Spinner UI to your res/layout/activity_xyz.xml
Make sure to give it a meaningful ID, especially if you have multiple Spinner items.
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/conversionSelectorSpinner" />
If your spinner will have a pre-defined list of items that will need to be translated to another language then you probably should use string-array in res/values/strings.xml
<string-array name="conversionTypeArray">
<item>meters to yards</item>
<item>kilometers to miles</item>
</string-array>
In your Activity class you have to add your Spinner in onCreate() method.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//set up the conversion choices using a Spinner
Spinner conversionSelectorSpinner = (Spinner) findViewById(R.id.conversionSelectorSpinner);
// create adapter from the res/values/strings.xml/string-array
// simple_spinner_item is a TextView
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.conversionTypeArray, android.R.layout.simple_spinner_item);
// simple_spinner_dropdown_item is basically a single line TextView that serves as header of a Spinner
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// set array adapter to populate the spinner
conversionSelectorSpinner.setAdapter(adapter);
Now if you build the APK we will have a Spinner, but we will have to make it work for us.
We will need a variable that will hold our selection, we will make it a class member to be used in various methods.
public class MainActivity extends ActionBarActivity {
private int selectedConversion = 0;
We will need a programmatic access to the string-array we defined, we will add that line inside our onCreate() method.
final String conversionTypeArray[] = getResources().getStringArray(R.array.conversionTypeArray);
Finally, we will have to add a event listener to our Spinner.
// add listener that will react when an item was selected
conversionSelectorSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
// assign selected item to the class member to be used later
selectedConversion = position;
// if you change conversion type, it is natural that the result will be different
calculateResult();
// we would not have debug toasts in production version, for edu purposes only
showToast("onItemSelected in position: " + position + " id: " + id + " selected name: " + conversionTypeArray[position]);
}
@Override
public void onNothingSelected(AdapterView<?> parentView) {
// onNothingSelected is a Callback method to be invoked when the selection disappears from this view.
// The selection can disappear for instance when touch is activated or when the adapter becomes empty.
showToast("onNothingSelected");
}
});
find similar posts:
Android,
Spinner
0
comments
Android: adding a Spinner (drop-down or pick-list widget)
You start by adding Spinner UI to your res/layout/activity_xyz.xml
Make sure to give it a meaningful ID, especially if you have multiple Spinner items.
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/conversionSelectorSpinner" />
If your spinner will have a pre-defined list of items that will need to be translated to another language then you probably should use string-array in res/values/strings.xml
<string-array name="conversionTypeArray">
<item>meters to yards</item>
<item>kilometers to miles</item>
</string-array>
In your Activity class you have to add your Spinner in onCreate() method.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//set up the conversion choices using a Spinner
Spinner conversionSelectorSpinner = (Spinner) findViewById(R.id.conversionSelectorSpinner);
// create adapter from the res/values/strings.xml/string-array
// simple_spinner_item is a TextView
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.conversionTypeArray, android.R.layout.simple_spinner_item);
// simple_spinner_dropdown_item is basically a single line TextView that serves as header of a Spinner
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// set array adapter to populate the spinner
conversionSelectorSpinner.setAdapter(adapter);
Now if you build the APK we will have a Spinner, but we will have to make it work for us.
We will need a variable that will hold our selection, we will make it a class member to be used in various methods.
public class MainActivity extends ActionBarActivity {
private int selectedConversion = 0;
We will need a programmatic access to the string-array we defined, we will add that line inside our onCreate() method.
final String conversionTypeArray[] = getResources().getStringArray(R.array.conversionTypeArray);
Finally, we will have to add a event listener to our Spinner. // add listener that will react when an item was selected
conversionSelectorSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
// assign selected item to the class member to be used later
selectedConversion = position;
// if you change conversion type, it is natural that the result will be different
calculateResult();
// we would not have debug toasts in production version, for edu purposes only
showToast("onItemSelected in position: " + position + " id: " + id + " selected name: " + conversionTypeArray[position]);
}
@Override
public void onNothingSelected(AdapterView<?> parentView) {
// onNothingSelected is a Callback method to be invoked when the selection disappears from this view.
// The selection can disappear for instance when touch is activated or when the adapter becomes empty.
showToast("onNothingSelected");
}
});
find similar posts:
Android,
Spinner
0
comments
Android apps now can run on every OS in a Chrome browser
Android apps can now run on every OS in a Chrome browser, or at least this can be shown to be possible. Tested on OS X, Windows and Ubuntu.
"ARChon runtime lets you run unlimited number of Android APKs created with
VIDEO DEMO
On personal note, the author of the hack, Mr. vladikoff001, is our developer hero of the mega proportions. Congratulations.
Yes, this is still a buggy hack, but it definitely opens doors for bigger and better future for this Android developer.
"ARChon runtime lets you run unlimited number of Android APKs created with
chromeos-apk on Chrome OS and across any desktop platform that supports Chrome."VIDEO DEMO
On personal note, the author of the hack, Mr. vladikoff001, is our developer hero of the mega proportions. Congratulations.
Yes, this is still a buggy hack, but it definitely opens doors for bigger and better future for this Android developer.
find similar posts:
Android,
Chrome browser
0
comments
Android apps now can run on every OS in a Chrome browser
Android apps can now run on every OS in a Chrome browser, or at least this can be shown to be possible. Tested on OS X, Windows and Ubuntu.
"ARChon runtime lets you run unlimited number of Android APKs created with
VIDEO DEMO
On personal note, the author of the hack, Mr. vladikoff001, is our developer hero of the mega proportions. Congratulations.
Yes, this is still a buggy hack, but it definitely opens doors for bigger and better future for this Android developer.
"ARChon runtime lets you run unlimited number of Android APKs created with
chromeos-apk on Chrome OS and across any desktop platform that supports Chrome."VIDEO DEMO
On personal note, the author of the hack, Mr. vladikoff001, is our developer hero of the mega proportions. Congratulations.
Yes, this is still a buggy hack, but it definitely opens doors for bigger and better future for this Android developer.
find similar posts:
Android,
Chrome browser
0
comments
Android Studio: Eclipse shortcuts and formatter
If you are switching between Eclipse (at work) and Android Studio (home, teaching) then you will run into a problem of remembering the keyboard shortcuts and formatting the code consistently.
In Android Studio you have an option to add "Eclipse Code Formatter" and specify the xml formatter you exported from Eclipse (for your whole team).
In Android Studio you have an option to add "Eclipse Code Formatter" and specify the xml formatter you exported from Eclipse (for your whole team).
You also have an option of using keymaps (keyboard shortcuts) from Mac Eclipse.
find similar posts:
Android,
Android Studio
0
comments
Android Studio: Eclipse shortcuts and formatter
If you are switching between Eclipse (at work) and Android Studio (home, teaching) then you will run into a problem of remembering the keyboard shortcuts and formatting the code consistently.
In Android Studio you have an option to add "Eclipse Code Formatter" and specify the xml formatter you exported from Eclipse (for your whole team).
In Android Studio you have an option to add "Eclipse Code Formatter" and specify the xml formatter you exported from Eclipse (for your whole team).
You also have an option of using keymaps (keyboard shortcuts) from Mac Eclipse.
find similar posts:
Android,
Android Studio
0
comments
GIT: submodules
In this tutorial you will see examples of how to work with modules in GTI. It is a good practice for multiple projects to re-use common libraries of code, for example model library, APIs, utility classes, etc.
find similar posts:
git,
submodule
0
comments
GIT: submodules
In this tutorial you will see examples of how to work with modules in GTI. It is a good practice for multiple projects to re-use common libraries of code, for example model library, APIs, utility classes, etc.
In your (parent) project clone another project as submodule..
$ git submodule add --force ssh://git@xyz.repositoryhosting.com/xyz/submodule_name.git module/submodule_name
If you checked out a base project and your submodule is empty, you need to initialize your submodules. The command below will bring the remote code to your local folders recursively for each submodule you have.
If the code you want in the submodule is in different branch then you have to checkout that branch
Finally you can do your normal PULL, or FETCH and REBASE
$ git submodule deinit -f module/myOldModule
List Submodules
$ git submodule
Add submodule to an existing project
Before I start, I like to check what is the repository URL of the PARENT project, your submodules will likely have similar URL:$ git config --get remote.origin.url
ssh://git@xyz.repositoryhosting.com/xyz/parent_project_name.git
In your (parent) project clone another project as submodule..
$ git submodule add --force ssh://git@xyz.repositoryhosting.com/xyz/submodule_name.git module/submodule_name
Cloning into 'module/submodule_name'...
remote: Counting objects: 47, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 47 (delta 6), reused 47 (delta 6)
Receiving objects: 100% (47/47), 1.85 MiB | 715.00 KiB/s, done.
Resolving deltas: 100% (6/6), done.
Checking connectivity... done.
If you checked out a base project and your submodule is empty, you need to initialize your submodules. The command below will bring the remote code to your local folders recursively for each submodule you have.
$ git submodule update -f --init --recursive
If the code you want in the submodule is in different branch then you have to checkout that branch
$ git submodule foreach git checkout develop
Finally you can do your normal PULL, or FETCH and REBASE
$ git submodule foreach git pull
Remove submodule
List currently registered submodules
$ git submodule
$ git submodule deinit -f module/myOldModule
$ git rm -rf module/myOldModule
$ rm -rf 'module/myOldModule'
find similar posts:
git,
submodule
0
comments
Eclipse: show hidden files
It is common that you need to edit hidden .* files, for example if you work with GIT you may want to edit .gitignore file.
In Eclipse > Package Explorer > select drop-down arrow "View Menu" > Filters ...
In Eclipse > Package Explorer > select drop-down arrow "View Menu" > Filters ...
Then unselect ".* resources" and the .gitignore .gitmodules, etc. should be showing.
find similar posts:
Android,
Eclipse,
git
0
comments
Eclipse: show hidden files
It is common that you need to edit hidden .* files, for example if you work with GIT you may want to edit .gitignore file.
In Eclipse > Package Explorer > select drop-down arrow "View Menu" > Filters ...
In Eclipse > Package Explorer > select drop-down arrow "View Menu" > Filters ...
Then unselect ".* resources" and the .gitignore .gitmodules, etc. should be showing.
find similar posts:
Android,
Eclipse,
git
0
comments
Eclipse not reading ANT env variables
Sometimes you have ANT build.xml that works perfectly from command line but does not execute in Eclipse:
BUILD FAILED
Execute failed: java.io.IOException: Cannot run program "${env.THRIFT_TOOL}": error=2, No such file or directory
When you inspect your build.xml you should have (true for any executable):
# Thrift tool - updated: Sept 16, 2014
Starting Eclipse from COMMAND LINE fixes the issue:
BUILD FAILED
Execute failed: java.io.IOException: Cannot run program "${env.THRIFT_TOOL}": error=2, No such file or directory
When you inspect your build.xml you should have (true for any executable):
<property environment="env"/><property name="thrift.compiler" value="${env.THRIFT_TOOL}"/>
If you inspect your env variable setting, on OSX ~/.profile you should have:
# Thrift tool - updated: Sept 16, 2014
export THRIFT_TOOL=/usr/local/bin/thrift
export PATH=${THRIFT_TOOL}:${PATH}
Yet Eclipse is not running Ant correctly!
$ bash -ic /Applications/../Eclipse.app/Contents/MacOS/eclipse
find similar posts:
Ant,
Eclipse,
Linux/Unix,
Mac,
Thrift
0
comments
Eclipse not reading ANT env variables
Sometimes you have ANT build.xml that works perfectly from command line but does not execute in Eclipse:
BUILD FAILED
Execute failed: java.io.IOException: Cannot run program "${env.THRIFT_TOOL}": error=2, No such file or directory
When you inspect your build.xml you should have (true for any executable):
# Thrift tool - updated: Sept 16, 2014
Starting Eclipse from COMMAND LINE fixes the issue:
BUILD FAILED
Execute failed: java.io.IOException: Cannot run program "${env.THRIFT_TOOL}": error=2, No such file or directory
When you inspect your build.xml you should have (true for any executable):
<property environment="env"/><property name="thrift.compiler" value="${env.THRIFT_TOOL}"/>
If you inspect your env variable setting, on OSX ~/.profile you should have:
# Thrift tool - updated: Sept 16, 2014
export THRIFT_TOOL=/usr/local/bin/thrift
export PATH=${THRIFT_TOOL}:${PATH}
Yet Eclipse is not running Ant correctly!
$ bash -ic /Applications/../Eclipse.app/Contents/MacOS/eclipse
find similar posts:
Ant,
Eclipse,
Linux/Unix,
macOS,
Thrift
0
comments
Thrift: building from source
I was required to build Thrift from sources (to adjust it to generate Parcelable Android model classes)
uki@ thrift $ .git clone https://github.com/apache/thrift.git
$ gcc --version
in my ~/.profile I added these 2 lines:
# C++ HOME - updated: Sept 16, 2014
now in the Terminal I can verify this:
uki@ thrift $ gcc --version
uki@ thrift $ .git clone https://github.com/apache/thrift.git
uki@ thrift $ cd thrift
uki@ thrift $ .git checkout 0.9.1
uki@ thrift $ ./cleanup.sh
uki@ thrift $ ./bootstrap.sh
uki@ thrift $ ./configure
uki@ thrift $ sudo make
uki@ thrift $ sudo make install
I get an error on my Mac:
./src/thrift/cxxfunctional.h:93:18: error: no member named 'bind' in namespace 'std'; did you mean 'find'?
Attempted solution 1:
I found a post on http://blog.evernote.com/
change file:
thrift/compiler/cpp/src/thriftl.ll
line 51 to #include "thrifty.hh"
src/thriftl.ll:51:10: fatal error: 'thrifty.hh' file not found
#include "thrifty.hh"
THIS SOLUTION CLEARLY DOES NOT WORK
Attempted solution 2:
As I was reading up I found that the version of my C++ might be wrong:
"libc++, the default C++ standard library in 10.9, doesn't include the experimental TR1 headers - just their standardized C++11 versions"
Checking the existing version of C++ on Mac:
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Installed newest C++ from brew
$ brew install gcc49
in my ~/.profile I added these 2 lines:
# C++ HOME - updated: Sept 16, 2014
export CPP_HOME=/usr/local/Cellar/gcc/4.9.1/bin/
export PATH=${PATH}:${CPP_HOME}
alias g++="/usr/local/Cellar/gcc/4.9.1/bin/cpp-4.9"
alias gcc="/usr/local/Cellar/gcc/4.9.1/bin/cpp-4.9"
now in the Terminal I can verify this:
uki@ thrift $ gcc --version
cpp-4.9 (Homebrew gcc 4.9.1) 4.9.1
The exercise is not complete yet, so I was not able to verify if this is a fix.
find similar posts:
brew,
C++,
gcc,
Thrift
0
comments
Thrift: building from source
I was required to build Thrift from sources (to adjust it to generate Parcelable Android model classes)
uki@ thrift $ .git clone https://github.com/apache/thrift.git
$ gcc --version
in my ~/.profile I added these 2 lines:
# C++ HOME - updated: Sept 16, 2014
now in the Terminal I can verify this:
uki@ thrift $ gcc --version
uki@ thrift $ .git clone https://github.com/apache/thrift.git
uki@ thrift $ cd thrift
uki@ thrift $ .git checkout 0.9.1
uki@ thrift $ ./cleanup.sh
uki@ thrift $ ./bootstrap.sh
uki@ thrift $ ./configure
uki@ thrift $ sudo make
uki@ thrift $ sudo make install
I get an error on my Mac:
./src/thrift/cxxfunctional.h:93:18: error: no member named 'bind' in namespace 'std'; did you mean 'find'?
Attempted solution 1:
I found a post on http://blog.evernote.com/
change file:
thrift/compiler/cpp/src/thriftl.ll
line 51 to #include "thrifty.hh"
src/thriftl.ll:51:10: fatal error: 'thrifty.hh' file not found
#include "thrifty.hh"
THIS SOLUTION CLEARLY DOES NOT WORK
Attempted solution 2:
As I was reading up I found that the version of my C++ might be wrong:
"libc++, the default C++ standard library in 10.9, doesn't include the experimental TR1 headers - just their standardized C++11 versions"
Checking the existing version of C++ on Mac:
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Installed newest C++ from brew
$ brew install gcc49
in my ~/.profile I added these 2 lines:
# C++ HOME - updated: Sept 16, 2014
export CPP_HOME=/usr/local/Cellar/gcc/4.9.1/bin/
export PATH=${PATH}:${CPP_HOME}
alias g++="/usr/local/Cellar/gcc/4.9.1/bin/cpp-4.9"
alias gcc="/usr/local/Cellar/gcc/4.9.1/bin/cpp-4.9"
now in the Terminal I can verify this:
uki@ thrift $ gcc --version
cpp-4.9 (Homebrew gcc 4.9.1) 4.9.1
The exercise is not complete yet, so I was not able to verify if this is a fix.
find similar posts:
brew,
C++,
gcc,
Thrift
0
comments
Subscribe to:
Comments (Atom)
Post Scriptum
The views in this article are mine and do not reflect those of my employer.
I am preparing to cancel the subscription to the e-mail newsletter that sends my articles.
Follow me on:
X.com (Twitter)
LinkedIn
Google Scholar
I am preparing to cancel the subscription to the e-mail newsletter that sends my articles.
Follow me on:
X.com (Twitter)
Google Scholar
Popular Recent Posts
-
Keishin Kata (敬心形) of Shobudo (正武道) karate kei (敬) respect, reverence, or honor someone or something shin (心) heart or mind kata (形) fo...
-
Before arriving in Okinawa, several experiences prepared me for what I would eventually learn there. Karate was the first. It introduced me ...
-
I came across Ruri Ohama mentioning a book by Takafumi Horie and Yoichi Ochiai titled: “Job Atlas for 10 Years From Now. How Will You Live i...
-
Please look at the newer post: http://ukitech.blogspot.com/2009/09/eclipse-35-galileo-and-gwt-m2-svn.html 1) Upload a new version of Eclipse...
-
I have a habit of "stopping to smell the roses", or as in today's case, to take a photo of baby mushrooms on the forest floor....
-
http://code.google.com/apis/socialgraph/
-
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space or Unable to execute dex: Java heap space Java h...
-
Step 1: Register you app with Facebook. Sign in to Facebook using your standard credentials. Navigate to http://www.facebook.com/developer...
-
Many online videos warn about vegetables you should never eat, especially those rich in oxalates. The tone is dramatic. The reality is much ...
Most Popular Articles
-
Affordance as a Function of Intent and Action? As a person passionate about Behavioral Sciences, I found myself unable to shake the impre...
-
Step 1: Register you app with Facebook. Sign in to Facebook using your standard credentials. Navigate to http://www.facebook.com/developer...
-
Please look at the newer post: http://ukitech.blogspot.com/2009/09/eclipse-35-galileo-and-gwt-m2-svn.html 1) Upload a new version of Eclipse...
-
Creating Android ROS nodes to: - add control UI (HMI) - utilize existing phone sensors: -- gyroscope -- GPS -- compass -- camera - do...
-
In this tutorial we will learn how to install the Intellij IDEA database plugin. Start with opening Settings > search for plugins ...
-
Installing TuriCreate on Python 3.6 Anaconda Environment 1) Check what Python version Apple Turi Create supports https://github.com/ap...
-
In this tutorial we will overview integration basics of Android Studio and Gradle build tools.
-
This tutorial shows you how to change the code lower/upper case of code in Android Studio.
-
ImportError : No module named 'sklearn.model_selection' Before doing the embarrassing things I did below, read this: Setting Jupy...
-
This minimal PyTorch example implements a custom recurrent neural network (RNN) cell from first principles, showing how sequence memory eme...
apt quotation..
“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.” by Robert A. Heinlein (author, aeronautical engineer, and naval officer)














