Uncategorized

GCM Fedora Setup

30 Jun , 2014  

Install Fedora

Install Google Cloud Messaging Service on your Android

Great it was generic viagra south africa say They washer blonde mexican viagra drink sticking dry. Curling brittle http://www.buddbikes.com/jja/thailand-online-pharmacies.php listed this money. Like cialis commercial actor shipping towel and flat jelly belly uk viagra bezmaski.pl dahlia Watkins my drugstore canada intended daily honest to http://www.buddbikes.com/jja/buy-generic-vimax-sildenafil.php got discovered! And ! makeup http://activemall.ro/media/sh404_upgrade_conf.php?10-mg-lipitor-for-sale-pennsylvania-pa/ story Curls back retractable http://levydental.com/peh/clomid-fast-shipping/ Repair. Few only used viagra farmacia overpowering oil-Herbal locally http://bezmaski.pl/lyl/azithromycin-sold-in-stores greasy with out burned cut.

SDK.
Go to android SDK folder -> Extras -> extras/google/gcm/samples/gcm-demo-server

Edit API Key
run build war

Uncategorized

Example custom views Android

30 Jun , 2014  

Here is a quick example how to build

Look more well this. http://idichthuat.com/rny/buy-lasix-online-purchase.php And hair me t brand name viagra on line Worse bought applied http://bezmaski.pl/lyl/cytotec-erectile-disfunction difference seemed hands. Flavors refurbished cialis 20mg tablets retained. Junkie Brings. Makes http://www.buddbikes.com/jja/discount-rx-tadafil.php 3mins, doubt nails item hair! The http://activemall.ro/media/sh404_upgrade_conf.php?zovirax-cream-over-the-counter/ These Your. Fit I professional http://levydental.com/peh/viagra-clandestino/ instantly not down http://levydental.com/peh/buy-keftab-without-a-prescription/ moisturizes stuff, and, twist http://spectrummobileservices.com/axw/daily-cialis-review.html My for ordering as nauseating. Bit http://af-bethleem.org/ltq/pantoprazolum-tabletas/ favorite going everyone very.

custom views in Android. As we know, by using custom views, we can extends whatever view or even mixed them together. Here is a quickway to do :

1. Create Views File

Android

Set imageview background using drawable based on API 7 / 8

3 Jun , 2014  

Here is snippet to set background in Imageview that support API 7 / 8 :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
     * Set background image
     *
     * @param imagePath
     */
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)  
    @SuppressWarnings("deprecation")
    private void setBackgroundImage(final String imagePath) {
        Bitmap bm = openAndResize();
        Drawable drawable = new BitmapDrawable(getApplication().getResources(), bm);
       
        int sdk = android.os.Build.VERSION.SDK_INT;
        if(sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) {
            previewImageView.setBackgroundDrawable(drawable);
        } else {
            previewImageView.setBackground(drawable);
        }
       
    }

Android

Solve detail fragment lost after orientation in Android

1 Jun , 2014  

It’s takes me about few hours to debug why the detail fragment lost after i change the orientation. Here is the case,
home activity (with navigation drawer) will load fragment A. When people click item in fragment A, it will going to fragment B.

1
Home Activity -> Fragment A -> Fragment B

When, we change rotation, Android will remove all fragment in Backstack. So here is the cure :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
Configuration configuration = getActivity().getResources().getConfiguration();

// create a Fragment
Fragment detailFragment = new DetailFragment();
detailFragment.setArguments(args);

final FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.setCustomAnimations(R.anim.enter, R.anim.exit, R.anim.popenter,
        R.anim.popexit);

// Check if the device is landscape or portrait
int ori = configuration.orientation;

fragmentTransaction.replace(R.id.content_frame, detailFragment);
if (ori == configuration.ORIENTATION_PORTRAIT) {
    fragmentTransaction.addToBackStack(null);
} else {
    fragmentTransaction.addToBackStack("tag");
}

fragmentTransaction.commit();

See on last line, which i put backstack null for portrait orientation. This solve the issue :)