Android hide

306 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
306
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Android hide

  1. 1. Android hide An unknown features
  2. 2. About Me Android developer ● Tempos 21 ● Catmóbil SCP ● Catdroid @lepetitbernat http://es.linkedin.com/in/bernatp
  3. 3. About speech Restricted profiles -> JellyBean+ Crash reports -> ApplicationErrorReport -> Send Feedback (2 ways) Hide intents -> Data usage
  4. 4. Restricted profiles Added in JellyBean ● Android 4.3 ● API 18+ ● Tablets
  5. 5. Restrictions TYPE_BOOLEAN TYPE_CHOICE TYPE_MULTI_SELECT BroadcastReceiver IntentFilter android.intent.action. GET_RESTRICTION_ENTRIES
  6. 6. extends BroadCastReceiver { onReceive(...) PendingResult result = goAsync(); new Thread() run() // ADD RESTRICTIONS CODE! Create broadcast
  7. 7. new ArrayList<RestrictionEntry>(); new RestrictionEntry(KEY_BOOLEAN, true); entry.setTitle("Dangerous enabled"); entry.setType(RestrictionEntry.TYPE_BOOLEAN); add(entry); CODE! Create restrictions
  8. 8. CODE! Bundle extras = new Bundle(); extras.putParcelableArrayList( Intent.EXTRA_RESTRICTIONS_LIST, restrictions); result.setResult(Activity.RESULT_OK, null, extras); result.finish(); Final steps!
  9. 9. UserManager usrManager = (UserManager) getSystemService(Context. USER_SERVICE); Bundle restrictions = usrManager.getApplicationRestrictions(getPackageName()); restrictions != null restrictions.get(...); CODE! Using restrictions
  10. 10. Restrictions Not enough?
  11. 11. Intent customIntent = new Intent(); customIntent.setClass(context, SettingsActivity.class); extras.putParcelable( Intent.EXTRA_RESTRICTIONS_INTENT, customIntent); result.setResult(Activity.RESULT_OK, null, extras); result.finish(); CODE! Custom restrictions
  12. 12. Links ● d.android.com ○ http://goo.gl/I0D3PU ● DevBytes ○ https://www.youtube.com/watch?v=pdUcANNm72o
  13. 13. Crash reports Added in IceCream ● Android 4.0 ● API 14+ ● Leave user write messages
  14. 14. Crash reports
  15. 15. Crash reports ApplicationErrorReport ● TYPE_NONE ● TYPE_CRASH ● TYPE_ANR ● TYPE_BATTERY ● TYPE_RUNNING_SERVICE
  16. 16. Exception e; ... report = new ApplicationErrorReport(); report.type = ApplicationErrorReport.TYPE_CRASH; ... crash= new ApplicationErrorReport.CrashInfo(); report.crashInfo = crash; ... arn = new ApplicationErrorReport.AnrInfo(); report.arnInfo = arn; … CODE! ApplicationErrorReport
  17. 17. Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName("com.google.android.feedback", "com.google. android.feedback.FeedbackActivity"); intent.putExtra(Intent.EXTRA_BUG_REPORT, report) startActivity(intent); CODE! Intent
  18. 18. Crash reports Intent.EXTRA_BUG_REPORT Intent.ACTION_APP_ERROR
  19. 19. CODE! Trick FeedbackException ● Custom message ● Custom class name ● Custom stacktrace ● User messages
  20. 20. Links ● d.android.com ○ http://goo.gl/QZnjZW ● Black feedback ○ http://stackoverflow.com/a/20848542 ● Google feedback ○ http://stackoverflow.com/a/22156938
  21. 21. Data usage
  22. 22. IntentFilter android.intent.action. MANAGE_NETWORK_USAGE CODE! ApplicationErrorReport
  23. 23. Questions ?
  24. 24. Thanks !https://github.com/alorma/Baug_Android_hide

×