Generate signed apk android studio

Step 1: Go to Build>Generate Signed APK>Next (module selected would be your module , most often called “app”)

Step 2:Click on create new

Step 3: Basically, fill in the form with the required details. The confusing bit it is where it asks for a Key Store Path. Click on the icon on the right with the 3 dots (“…”), which will open up a navigator window asking you to navigate and select a .jks file.Navigate to a folder where you want your keystore file saved and then at the File Name box at the bottom of that window, simply enter a name of your liking and the OK button will be clickable now. What is happening is that the window isnt really asking you chose a .jks file but rather it wants you to give it the location and name that you want it to have.

Step 4:Click on Next and then select Release and Voila ! you are done.

Android – Search ListView content using BaseAdapter

I am having a ListView and I have inserted values using BaseAdapter, but I realized that to search we have to use ArrayAdapter it working fine with the help of getfilter().but when i am going with BaseAdapter using getfilter() That Time Created Problem because getfilter()not supported in BaseAdapter You need to make custom getfilter().

1)Create EditTextView in XML file For Enter The Elements you want to Search.
<EditText android:id=”@+id/inputSearch”
android:layout_width=”fill_parent”
android:gravity=”center”
android:layout_height=”wrap_content”
android:hint=”Search User”/>

2)Bind This Id in JAVA file an Perform addTextChangedListener event.

inputSearch.addTextChangedListener(new TextWatcher() {

@Override
public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
// When user changed the Text
mAdapter.getFilter().filter(cs);

}

@Override
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
int arg3) {
// TODO Auto-generated method stub+
}

@Override
public void afterTextChanged(Editable arg0) {
// TODO Auto-generated method stub

}
});
getfilter() are not supported in BaseAdapter.so you need to Custom create the getfilter method.

3)you need to implemented BaseAdapter using Filterable.it will create override methods.

@Override
public Filter getFilter() {
Filter filter = new Filter() {

@SuppressWarnings(“unchecked”)
//publishResults also override methods of getfilter
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {

listValues = (ArrayList<String>) results.values;
notifyDataSetChanged();
}

//performFiltering also override methods of getfilter
@Override
protected FilterResults performFiltering(CharSequence constraint) {
String dataNames=””;
FilterResults results = new FilterResults();
//FilteredArrayNames is the temp listview for filter char
ArrayList<String> FilteredArrayNames = new ArrayList<String>();

listValues=listValues1;
// perform your search here using the searchConstraint String.

constraint = constraint.toString().toLowerCase();
//if(constraint.toString().trim().length()>0){
for (int i = 0; i < listValues1.size(); i++) {
//listValues1 is also second listvalues arrays
//listValues is first listValues arrays
dataNames = listValues1.get(i);
//getting listValues1 to dataNames which are we enter..

if (dataNames.toLowerCase().contains(constraint.toString().trim())) {
//add enter char to filter listview.
FilteredArrayNames.add(dataNames);

}

}
results.count = FilteredArrayNames.size();
results.values = FilteredArrayNames;
return results;
}
};
return filter;
}
}

About the 64K limit & MultiDex Not Supporting.

Android app (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536—including Android framework methods, library methods, and methods in your own code. In the context of computer science, the term  denotes 1024 . Because 65,536 is equal to 64 X 1024, this limit is referred to as the ’64K reference limit’.

Multidex support prior to Android 5.0

Versions of the platform prior to Android 5.0 (API level 21) use the Dalvik runtime for executing app code. By default, Dalvik limits apps to a singleclasses.dex bytecode file per APK. In order to get around this limitation, you can use the multidex support library, which becomes part of the primary DEX file of your app and then manages access to the additional DEX files and the code they contain.

Continue reading About the 64K limit & MultiDex Not Supporting.