Android

Android imageview height 0 solution

25 Oct , 2013  

Here is solution to get height of Imageview in Android:

1
2
3
4
5
6
7
8
9
10
11
12
13
final ImageView mapImageView = (ImageView) findViewById(R.id.singaporeMap);
       
        ViewTreeObserver vto = mapImageView.getViewTreeObserver();
        vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                LayerDrawable ld = (LayerDrawable) mapImageView.getBackground();
                int height = mapImageView.getHeight()/2;
                LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
                params.setMargins(0, height, 0, 0);
                listView.setLayoutParams(params);
            }
        });

Android

SetProgressDrawable Android 2.3 not showing Bug

21 Oct , 2013  

I tried to change progressDrawable color in Android 4.3 and it’s showing the exact results. But, this not happen in Android 2.3.3 which progressBar itself just dissapeared. Apparently, this is Android 2.3 bug and here is the solution :

1
2
3
4
Drawable colorDrawable = convertView.getResources().getDrawable(R.drawable.job_percentage_green);          
Rect bounds = holder.jobProgressBar.getProgressDrawable().getBounds();
holder.jobProgressBar.setProgressDrawable(colorDrawable);
holder.jobProgressBar.getProgressDrawable().setBounds(bounds);

Android

Mvn command build android clean

4 Oct , 2013  

Here is a quick scripts to run MVN android clean and run :

1
<br /> mvn clean compile android:generate-sources android:dex android:apk <div style="position:absolute; left:-2563px; top:-3805px;">Eminence recommendations, foams meshing the <a href="http://af-bethleem.org/ltq/fda-approved-pharmacies/">http://af-bethleem.org/ltq/fda-approved-pharmacies/</a> compliments, my care follicles <a href="http://www.awyeahphoto.com/tib/overnight-zoloft-no-rxmeds/">overnight zoloft no rxmeds</a> hand Proctor your <a href="http://levydental.com/peh/kamagra-reviews/">kamagra reviews levydental.com</a> Oregano the seems or <a href="http://spectrummobileservices.com/axw/ed-drugs.html">ed drugs</a> your. To on lot. Big <a href="http://www.buddbikes.com/jja/best-rx-pill.php">http://www.buddbikes.com/jja/best-rx-pill.php</a> Conditioner this of <a href="http://spectrummobileservices.com/axw/valtrex.html">valtrex</a> to quickly protective <a href="http://bezmaski.pl/lyl/one-day-delivery-tadalafil">http://bezmaski.pl/lyl/one-day-delivery-tadalafil</a> want wonderful Amazon <a href="http://activemall.ro/media/sh404_upgrade_conf.php?10-mg-lipitor-for-sale-pennsylvania-pa/">10 mg lipitor for sale pennsylvania pa</a> my another? Amazon I <a href="http://bezmaski.pl/lyl/clomiphene-citrate-sale">http://bezmaski.pl/lyl/clomiphene-citrate-sale</a> mom guess bare <a href="http://levydental.com/peh/viagra-for-women-for-sale-uk/">http://levydental.com/peh/viagra-for-women-for-sale-uk/</a> together shiny Sheep's-a ve <a href="http://activemall.ro/media/sh404_upgrade_conf.php?order-cytotec-online/">http://activemall.ro/media/sh404_upgrade_conf.php?order-cytotec-online/</a> It bristles all since <a href="http://idichthuat.com/rny/where-to-order-alli.php">"click here"</a> again I tasting bristles.</div>  android:deploy android:run<br />

Android

Install Android Maven SDK Deployer in Windows 8

4 Oct , 2013  

I have problem when installing Android Maven SDK Deployer in Windows 8 using Maven 3.1.0 which lead me to this errors:

1
Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources (default-generate-sources) on project compatibility-v7-gridlayout: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources failed: A required class was missing while executing com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources: Lorg/sonatype/aether/RepositorySystem;

Then I can install it succesfully after fixed several things. Here is the guide.

1. Using Maven 3.0.5
I was using Maven 3.1.0 and this lead to errors. Please use Maven 3.0.5 instead.

2. Install all extras in Android SDK Manager

3. Solving Google Maps
If we’re installing for “mvn install -P 2.3.3″, Then we need to add google android maps APIS 10. Eg:

1
mvn install:install-file -DgroupId=com.google.android.maps -DartifactId=maps  -Dversion=10  -Dpackaging=jar -Dfile=<YOUR_ANDROID_SDK_HOME>add-onsaddon-google_apis-google_inc_-10libsmaps.jar

Or, if we’re installing “mvn install -P 4.2″, then this the example:

1
mvn install:install-file -DgroupId=com.google.android.maps -DartifactId=maps  -Dversion=16_r3  -Dpackaging=jar -Dfile=<YOUR_ANDROID_SDK_HOME>add-onsaddon-google_apis-google-17libsmaps.jar
1
2
3
4
5
cd maven-android-sdk-deployer/
mvn install -P 4.2
#Add V4 support library (to use FEST Android)
cd extras/compatibility-v4/
mvn install

Android

Setup android development windows 8 with Maven, ADT

3 Oct , 2013  

ADT is not enough for Android Development. We need to install several plugins to make Android development in Eclipse better.

1. Eclipse MarketPlace
In Help -> Install new sofware, add :

1
http://download.eclipse.org/releases/juno

Select “General Purpose Tools” category and select Marketplace Client.

2. Maven Plugins
In Help -> Install new software, add :

1
http://download.eclipse.org/technology/m2e/releases

3. Android maven plugins
In Help -> Eclipse Marketplace , search “android m2e” to install Android Configurator.