[Solved] instant messages android application [closed]

Simple Android Instant Messaging Application Simple because it is not a kind of application for end users. This is a simple IM application runs on Android, application makes http request to a server, implemented in php and mysql, to authenticate, to register and to get the other friends’ status and data, then it communicates with … Read more

[Solved] Building a menu in Android [closed]

This is a sample code I made. all of them are buttons in xml public class MenuActivity extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } @Override // My menu inflater public boolean onCreateOptionsMenu(Menu menu) { new MenuInflater(this).inflate(R.menu.menu, menu); return (super.onCreateOptionsMenu(menu)); } // code for the actions that it … Read more

[Solved] how can we send data from first activity to second activity and second activity to first activity bu using intent [duplicate]

first, define a variable in you first activity like this (100 is just random, pick whatever you want): private static final int SECOND_ACTIVITY = 100; then in your first activity you start the second activity like this: Intent intent = new Intent(FirstActivity.this, SecondActivity.class); startActivityForResult(intent, SECOND_ACTIVITY); also override onActivityResult in your first activity: @Override protected void … Read more

[Solved] Android Studio doesn’t recognize images in hdpi folder

Try making new drawable folders for putting images after right clicking res folder and name folders like this drawable-hdpi drawable-mdpi drawable-xhdpi drawable-xxhdpi drawable-xxxhdpi Drag and drop image with same name according to their dimensions. The android takes drawable folder as one entity, picks up the best suited image and shows it on different resolution phones. … Read more

[Solved] Is there anybody can help me ? I want to choose some sound ( anywhere in the phone) and send information of this sound to another Activity to play it [closed]

Okay, Here you go Set the path of file like this- String SD_CARD_PATH = Environment.getExternalStorageDirectory().toString(); new File(SD_CARD_PATH + “https://stackoverflow.com/” + “your_file_name.mp3”); Code from this SO answer and use android MediaPlayer to play the song. public void playSong(String file_path){ MediaPlayer mediaPlayer = new MediaPlayer(); try{ mediaPlayer.setDataSource(file_path); mediaPlayer.prepare(); mediaPlayer.start(); } catch (Exception e) { e.printStackTrace(); } } … Read more

[Solved] How to execute the asynchronous task several times?

You can iterate through the list size and call asynchronous task in that. for(int i=0; i<list.size();i++) { // Call AsyncTask with any value you want to pass // just generate a constructor accordingly new AsyncTask(i).execute(); } And get the value in AsyncTask class with required constructor : public class AsyncTask{ Integer position; public AsyncTask(Integer passedValue) … Read more

[Solved] Find an easy web server framework for mobile game [closed]

You should try out Firebase (https://www.firebase.com/) if you’re looking for something relatively easy to store game data with. If you’re looking for something to manage logins and storing simple data, either Twitter’s Fabric (https://get.fabric.io/) and AWS Cognito (https://aws.amazon.com/cognito/) can also be used as well 2 solved Find an easy web server framework for mobile game … Read more

[Solved] Android Photo Upload

So after lots of tweaking and research i found out that the way i passed the image was wrong. On the code I had yesterday, I converted the image bitmap to base64 string and then convert that string to bytes array. This was wrong as I have to convert the bitmap image to bytes array … Read more

[Solved] Get Contact Name Through Contact Number [duplicate]

private String getContactNameFromNumber(String number) { Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number)); Cursor cursor = context.getContentResolver().query(uri, new String[]{PhoneLookup.DISPLAY_NAME},null,null,null); if (cursor.moveToFirst()) { name = cursor.getString(cursor.getColumnIndex(PhoneLookup.DISPLAY_NAME)); } return name; } solved Get Contact Name Through Contact Number [duplicate]

[Solved] Item gets duplicated in adapter, when we delete or update item from Firebase Realtime Database

This Solution work for me : This code will remove last item in adapter after performing deletion operation in firebase realtime database. mAcceptedList.removeAt(adapterPosition); mShortlistProfileAdapter.notifyDataSetChanged() override fun onItemClicked( adapterPosition: Int, mUserListProfile: ArrayList<UserProfile> ) { mShortlistedProfileVM?.deleteUserProfile(mUserListProfile.get(adapterPosition)) mAcceptedList.removeAt(adapterPosition); mShortlistProfileAdapter.notifyDataSetChanged() } } To Prevent item gets duplicated. Clear your list before adding data into list. mAcceptedList.clear() <—add this line … Read more