Display a dialog on booking detail activity while the users click on the cancel booking. In detail, if the booking is confirmed by professional the cancel booking status within 24 hours charged 20%; if out of 24 hours charged 30%; else the booking are pending not charged.
the photo taking function with camera or selecting pictures from library. In general, once the users click on the add photo, a dialog should be sliding in from bottom of the screen. Lastly, I created a Cloudinary account to upload an image to the cloud
Firstly, added permissions camera and wrote an external storage into manifest file. Secondly, created a custom bottom dialog. OnActivityResult is very important as we can get image Uri after taking pictures or selecting pictures
Once the users click on nearby location the result should get the current longitude and latitude. Moreover, alert dialog needs to be prompted out when the user does not turn on the GPS.
I added permission on Android Mainifest in order to retrieve the current location. Also, I appended LocationListener into the project as well.
Sample code getLocation:
public Location getLocation() { try { locationManager = (LocationManager) mContext .getSystemService(LOCATION_SERVICE); // getting GPS status isGPSEnabled = locationManager .isProviderEnabled(LocationManager.GPS_PROVIDER); // getting network status isNetworkEnabled = locationManager .isProviderEnabled(LocationManager.NETWORK_PROVIDER); if (!isGPSEnabled && !isNetworkEnabled) { showSettingsAlert(); // no network provider is enabled } else { this.canGetLocation = true; // First get location from Network Provider if (isNetworkEnabled) { if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(mContext, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(mContext, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { } locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, 0, 0, this); Log.d("Network", "Network"); if (locationManager != null) { location = locationManager .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); if (location != null) { latitude = location.getLatitude(); longitude = location.getLongitude(); } } } // if GPS Enabled get lat/long using GPS Services if (isGPSEnabled) { if (location == null) { locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, this); Log.d("GPS Enabled", "GPS Enabled"); if (locationManager != null) { location = locationManager .getLastKnownLocation(LocationManager.GPS_PROVIDER); if (location != null) { latitude = location.getLatitude(); longitude = location.getLongitude(); } } } } } } catch (Exception e) { e.printStackTrace(); } return location; }
Adding the slide image
use online library multiviewpager to make slide image.
Following the method I had implemented, I found out a problem of retrieving picture from database as the existing approach was manually stored into array before this was being displayed in the picture
Sample code :
public static SlideImageFragment create(List<SlideImage> imageList, int position) { SlideImageFragment fragment = new SlideImageFragment(); fragment.position = position; fragment.imageList = imageList; return fragment; } @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { SlideImage slideImage = imageList.get(position); View rootView = inflater.inflate(R.layout.sliding_image_layout, container, false); imageView = (ImageView) rootView.findViewById(R.id.sliding_image); Picasso.with(context).load(slideImage.getImg_url()).placeholder(R.mipmap.ic_launcher).centerCrop().fit().into(imageView); rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Gson gson = new Gson(); String myJson = gson.toJson(imageList); Intent intent = new Intent(context, ZoomablePhotoGalleryActivity.class); intent.putExtra("portfolioList", myJson); intent.putExtra("position", String.valueOf(position)); context.startActivity(intent); context.overridePendingTransition(R.anim.enter, R.anim.exit); } }); return rootView; }
Facebook Login on Android App
Facebook login feature. Be specific, once the users have successful log on, the application should get the user profile picture, ID and name
Once the users click on the Facebook login button, the authentication is done via the referenced Facebook SDK library. To successfully run the Facebook Login, I have to add in Android development key hash to my Facebook developer profile. Facebook uses the key hash to authenticate interactions between the app and the Facebook app. To generate key hash I had installed openSSL then go to command line to get the key hash from the keystore
Following the Facebook developer guideline, there was the key hash discrepancy problem while logging into the Facebook. To generate key hash again, I had installed openSSL then went to command line to get the key hash from the keystore
The creation of slide navigation call “hamburger” feature for my upcoming Android project. Firstly, the home activity contains tab layout with fragment. Secondly, Gridview in a fragment needs to be created in tab1 somehow the image cannot be scrolled smoothly
The reason to using fragment is to merge multiple fragments in a single activity, build a multi-pane UI, and reuse a fragment in multiple activities
To improve the loading speed of images scrolling, I were suggested to use holder and Picasso to load image faster as it allows hassle-free image loading in my application.
ListView itself has its own scrolling functionality and the main thing is Scrollview can host only one direct child. The result I have ListView in ScrollView does not display all items. In order to solve this issue, ListView was inserted into Linear layout