[Solved] Algorithm mcrypt AES for Android?

For reversible AES encryption, you can use this code. But I see you are trying to encrypt password, which is considered to be a bad idea. If you need to store user passwords, use hashing algorithms – I highly suggest SHA-512 with PBKDF2 (50 000 derivations should be enough). 5 solved Algorithm mcrypt AES for … Read more

[Solved] Android AsyncTask PostExecute [closed]

If you want to perform some function once the Asynctask is complete, you can setup a callback function in the calling activity. Create a constructor in the AsyncTask class and pass it the calling activity. Then use this reference to call the callback function when your task is complete. You can also update the UI … Read more

[Solved] Change version of APK

In targetSdkVersion Set maximum sdk version. if you set 21 than your application will work still 21 api. <uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”21″ /> 2 solved Change version of APK

[Solved] android while loop alternative

running while loop codes on the main thread freezes the UI, and makes all other processes pause making your app unresponsive use Threads.. also note that the while loop you are running is running on a default Thread termed as the ui thread so in short run while loops on separate threads.. eg.. new Thread(new … Read more

[Solved] How I insert color in a border of EditText?

create a xml file with the below code into the drawable folder as “edittextborder.xml” <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <solid android:color=”#FDEEF4″ /> <corners android:radius=”15dp” /> <stroke android:width=”1dip” android:color=”#2B65EC” /> </shape> where #2B65EC represents the border of the edittext color. “#2B65EC” – ocean blue Also refer this one to the Edittext code as below one <EditText android:id=”@+id/password” android:layout_width=”200dp” … Read more

[Solved] what is the best coding strategy for supporting pre-3.0 devices with android support library and after-3.0 without it? [closed]

The general pattern is that you use the backport so long as your android:minSdkVersion indicates that you need the backport. So, if your android:minSdkVersion is set to 10 or lower, you will: Need to use the Android Support package’s backport of fragments, if you want to use fragments or loaders Need to use ActionBarSherlock or … Read more

[Solved] Emails in C2DM?

It seems that you are under the wrong impression that the Role Email account which is created to identify the application using the C2DM service should be changed in the registration intent. You must have that role email the same as the one on the server otherwise Google will not be able to identify your … Read more

[Solved] Adding multiple views to a view [duplicate]

See this is sample code, this might helpful for you. Instaed of LockView you can mention other views.. lockLayout = (LinearLayout) findViewById(R.id.quick_lock_layout); private void renderLockLayout() { lockLayout.removeAllViews(); lockLayout.invalidate(); lockLayout.setLayoutParams(new LinearLayout.LayoutParams( lockLayoutWidth + 7, (height / 6))); /* * Toast.makeText(ApplicationContext.getContext(), “Num count is :” + * _totalLocks, Toast.LENGTH_SHORT).show(); */ Log.i(getClass().getSimpleName(), “Total :” + _totalLocks); lockViewArray = … Read more

[Solved] Error encountered while retrieving the Android version [closed]

Hope this helps!MainActivity,java package com.example.versioninfo; import android.app.Activity; import android.os.Build; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView versionInfo = (TextView) findViewById(R.id.verInfo); versionInfo.setText(“Android “+Build.VERSION.RELEASE); } } activity_main.xml <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:id=”@+id/tv” android:layout_width=”match_parent” android:layout_height=”match_parent” android:paddingBottom=”@dimen/activity_vertical_margin” android:paddingLeft=”@dimen/activity_horizontal_margin” android:paddingRight=”@dimen/activity_horizontal_margin” android:paddingTop=”@dimen/activity_vertical_margin” tools:context=”com.example.versioninfo.MainActivity” > <TextView android:id=”@+id/verInfo” … Read more

[Solved] How to get file size in KB and MB in android [duplicate]

Here it’s: public String size(int size){ String hrSize = “”; double m = size/1024.0; DecimalFormat dec = new DecimalFormat(“0.00″); if (m > 1) { hrSize = dec.format(m).concat(” MB”); } else { hrSize = dec.format(size).concat(” KB”); } return hrSize; } SOURCE: Converting KB to MB, GB, TB dynamically 1 solved How to get file size in … Read more