android - Why deprecation happens? -


What is the reason that the Android development team is pushing for some system methods to be erased, I know that something like that The methods that are replaced by other methods are more handful and useful but some have not changed in other ways in other ways or have just been replaced with a generalized large method which try to deal with some elements more specifically Tax Areas of support will not, for example date class:

  Date mDate = new Date (); MDate.getDate (); // exclusion mDate.getDay (); // Excluded mDate.getHours (); // Excluded mDate.getMinutes (); // deprecated mDate.getMonth (); // deprecated mDate.getSeconds (); // deprecated mDate.getYear (); // Excluded mDate.getTimezoneOffset (); // Excluded  

and only one now exists:

  mDate.getTime (); // gives full time & amp; Now when  gets the date object  and attempts to get the  year , now, in milliseconds, the date as a `long` value in milliseconds  

  1. Announce a new calendar object .
  2. This makes an example of the calendar class .
  3. The time of this calendar object sets the date I received.
  4. Remove the required attributes from this calendar object.

What if that data object is the same as the date zero in time? Now I have to sort out an alternate to save it before deciding the time of the calendar, then save it Reset time after application after that date.

Another example that shows the whole <<>

the third example when you want to get the screen width & amp; height , which was direct:

  int window wide, windowHeight; WindowWidth = getWindowManager () GetDefaultDisplay () GetWidth (); // Dislike WindowHyat = getWindowManager () GetDefaultDisplay () GetHeight (); // Excluded  

but now:

  int window wide, window height; Display Metrics Metrics = New Performance Metals (); . MContext.getWindowManager () getDefaultDisplay () getMetrics (metrices). WindowWidth = Metrics Wide pixel; Windowhit = matrices High pixel;  

methods of java.util.Date Has been disliked by the Android team, but was deprecated by the Sun in Java 1.1 . This is just one example of java heritage. If you think the Calendar API is unmanageable, then I consider using Add Time instead.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -