Android: copy database from asset folder, but only get an empty file

guys, I have the problem when copying database from local assets folder to /data/data/package_name/databases directory. As I use the http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ tutorial to do it, I can only get an empty file. I quoted the part of copyDataBase() method and there is no difference. Every time the app start, it will create the directory and empty […]

In-app purchases to unlock paid functions

I am looking to release two version of my app: free and paid. The paid app will have a few more functions but no extra content as such. Originally I was going to release two separate apps on the market but it is proving difficult to keep a single code base and have two separate […]

particle effects?

I want to achieve particle effect when an object is found. I have relative Layout on which I have many ImageViews are Placed now when user click on the ImageViews I want some particle effect to happen ( I do not want sprite animation ). How will I achieve it ? any good reference or […]

How to show progress bar in each listview item?

please help me out to show the progress dialog in listview item. public class DealerSubCatListAdapter extends BaseAdapter { private Context context; private ArrayList<Image> Image; private LayoutInflater inflater = null; public DealerSubCatListAdapter(Context context, ArrayList<Image> Image) { this.context = context; this.Image = Image; inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); notifyDataSetChanged(); } @Override public int getCount() { return Image.size(); […]

Disable click on RecyclerView inside a SwipeRefreshLayout

I implemented a SwipeRefreshLayout using a RecyclerView and I need that my adapter items are disabled during the OnRefreshListener. I tried the following approach, but the click occurs normally: mRecyclerView.setEnabled(false); mRecyclerView.setClickable(false);

Loading Android Google Map fragment managed by ViewPager

I can load a google map into an Android fragment that’s within an activity. That has been working fine. But now I want to use ViewPager to navigate between views (class android.support.v4.app.Fragment). It doesn’t seem possible to load a com.google.android.gms.maps.MapFragment into such a fragment. For example, in: import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; […]

getSupportFragmentManager doesn't compile on DialogFragment

How can I show this : public class TagsDialog extends DialogFragment { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); builder.setView(inflater.inflate(R.layout.tags_dialog, null)); builder.setMessage(“This is a message”).setTitle(“TAGS”); return builder.create(); } } From inside my Fragment inside a ViewPager : public class MyFragment extends Fragment { @Override public View onCreateView(LayoutInflater […]

Getting Reference to Calling Activity from AsyncTask (NOT as an inner class)

Is it at all possible, from within an AsyncTask that is NOT an inner class of the calling Activity class, to get a reference to the instance of Activity that initiated execution of the AsyncTask? I am aware of this thread, however it doesn’t exactly address how to reference the calling Activity. Some suggest passing […]

Android ShowCaseView's buttonLayoutParams won't work

I’m using ShowCaseView library in my app. And I want to move the ‘OK’ button to the left. I used this code (the same in the library): // The following code will reposition the OK button to the left. RelativeLayout.LayoutParams lps = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); lps.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); lps.addRule(RelativeLayout.ALIGN_PARENT_LEFT); int margin = ((Number) (getResources().getDisplayMetrics().density * 12)) […]

How do I avoid typing “android” for every attribute?

I am new to Android development and am also a designer doubling as a front-end guy. How can I avoid having to type android: every time I add an attribute? In other text editors (TextMate), I can trigger snippets by typing a known trigger and tab to auto-complete the word. Is there something similar for […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.