Log.d("error", "There is a crash somewhere or any warning"); Logger.addLogAdapter(new AndroidLogAdapter()); Logger.d("message"); .build(); Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy)); Logger.addLogAdapter(new AndroidLogAdapter() { @Override public boolean isLoggable(int priority, String tag) { return BuildConfig.DEBUG; .build(); Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy)); Logger.i("no thread info and method info"); .tag("MyTag") .build(); Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
@Override public boolean isLoggable(int priority, String tag) { return BuildConfig.DEBUG && super.isLoggable(priority, tag); } });
@Override public boolean isLoggable(int priority, @Nullable String tag) { if (!BuildConfig.DEBUG) { return false; } return super.isLoggable(priority, tag); } });
@Override public void onCreate() { super.onCreate(); mInstance = this; Logger.addLogAdapter(new AndroidLogAdapter()); }
@Override public void isLogAble(boolean isLog) { Logger.addLogAdapter(new AndroidLogAdapter(){ @Override public boolean isLoggable(int priority, String tag) { return isLog; } }); }
@Override public void onCreate() { super.onCreate(); initTimeber(); Logger.addLogAdapter(new AndroidLogAdapter()); }
@Override public void onCreate() { super.onCreate(); initTimeber(); Logger.addLogAdapter(new AndroidLogAdapter()); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_movie_list); ButterKnife.bind(this); Logger.addLogAdapter(new AndroidLogAdapter()); //Send GET request to server to fetch movie list AND load them into RecyclerView getMovieListFromServer(); }
public static void createNotification(String title, String message, String activity, int notificationId, Context context) throws ClassNotFoundException { Intent intent = new Intent(context, Class.forName(activity)); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // int requestCode = 0; PendingIntent pendingIntent = PendingIntent.getActivity(context, notificationId, intent, PendingIntent.FLAG_ONE_SHOT); Uri sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder noBuilder = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.ic_notifications_black_24dp) .setContentTitle(title) .setContentText(message) .setAutoCancel(true) .setContentIntent(pendingIntent) .setSound(sound); NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(notificationId, noBuilder.build()); //0 = ID of notification Logger.addLogAdapter(new AndroidLogAdapter()); Logger.d("Notification created"); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_movie_list); ButterKnife.bind(this); Logger.addLogAdapter(new AndroidLogAdapter()); progressDialog = new ProgressDialog(this); progressDialog.setTitle("Loading"); progressDialog.setMessage("Movie list loading from server. Please wait..."); if(Util.isInternetAvailable(this)){ //Send GET request to server to fetch movie list AND load them into RecyclerView progressDialog.show(); getMovieListFromServer(); } else Toast.makeText(this, "Check your internet", Toast.LENGTH_LONG).show(); swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { //when internet is available and user pull to refresh //Send GET request to server to fetch movie list AND load them into RecyclerView if(Util.isInternetAvailable(getApplicationContext())) getMovieListFromServer(); else { swipeRefreshLayout.setRefreshing(false); Toast.makeText(getApplicationContext(), "Check your internet", Toast.LENGTH_LONG).show(); } } }); }
@Override public void run() { NetService.getInstance().init(cityUrl); Logger.addLogAdapter(new AndroidLogAdapter()); } }).start();
@Override public void onCreate() { super.onCreate(); Logger.addLogAdapter(new AndroidLogAdapter()); if (SettingsHelper.logging(this)) { if (ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { Logger.addLogAdapter(new DiskLogAdapter()); } else { PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit() .putBoolean(getString(R.string.key_pref_logging), false) .apply(); } } startService(new Intent(this, ActivityLogService.class)); Logger.log(Logger.ASSERT, null, "======Easer started======", null); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_movie_details); ButterKnife.bind(this); Logger.addLogAdapter(new AndroidLogAdapter()); getSupportActionBar().setDisplayHomeAsUpEnabled(true); Movie movie = getIntent().getParcelableExtra(Config.MOVIE); /* Print the movie object as JSON in log message. Just for checking the data is valid or not */ Gson gson = new Gson(); String movieJson = gson.toJson(movie, Movie.class); Logger.json(movieJson); //End of log message print Picasso.with(this) .load(movie.getImage()) .into(imageView); movieNameTextView.setText(movie.getName()); directorNameTextView.setText(movie.getDirector()); movieTypeTextView.setText(movie.getType()); ratingTextView.setText(String.valueOf(movie.getRating())); plotTextView.setText(movie.getPlot()); }
@Override public void onCreate() { super.onCreate(); AppUtil.init(this); PrettyFormatStrategy strategy = PrettyFormatStrategy.newBuilder() .tag(getString(R.string.app_name)) .showThreadInfo(false) .build(); AndroidLogAdapter logAdapter = new AndroidLogAdapter(strategy); Logger.addLogAdapter(logAdapter); Schedulers.io().createWorker().schedule(() -> songTi = Typeface.createFromAsset(getAssets(), "SongTi.TTF")); } }
@Override public void setGlobalTag(String tag) { FormatStrategy formatStrategy= PrettyFormatStrategy.newBuilder() .tag(tag).build(); Logger.clearLogAdapters(); Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy)); } }
public static void init() { PrettyFormatStrategy strategy = PrettyFormatStrategy.newBuilder() .showThreadInfo(false) .methodCount(0) .methodOffset(0) .tag(Constants.TAG) .build(); AndroidLogAdapter androidLogAdapter = new AndroidLogAdapter(strategy); com.orhanobut.logger.Logger.addLogAdapter(androidLogAdapter); }
@Override public void onCreate() { super.onCreate(); Logger.addLogAdapter(new AndroidLogAdapter()); DatabaseManager.initializeInstance(this); sAppComponent = DaggerAppComponent.create();
@Override public void onCreate() { super.onCreate(); Logger.addLogAdapter(new AndroidLogAdapter()); setWeiboApplication(this); mOauth2AccessToken = Session.restore(sWeiboApplication); int memClass = ((ActivityManager) sWeiboApplication.getSystemService( Context.ACTIVITY_SERVICE)).getMemoryClass(); // Use 1/8th of the available memory for this memory cache. int cacheSize = 1024 * 1024 * memClass / 8; mImageLoader = new ImageLoader(getRequestQueue(), new BitmapLruCache(cacheSize)); // set the max number of concurrent network connections, default is 4 AjaxCallback.setNetworkLimit(8); // set the max number of icons (image width <= 50) to be cached in // memory, default is 20 BitmapAjaxCallback.setIconCacheLimit(40); // set the max number of images (image width > 50) to be cached in // memory, default is 20 BitmapAjaxCallback.setCacheLimit(40); // set the max size of an image to be cached in memory, default is 1600 // pixels (ie. 400x400) BitmapAjaxCallback.setPixelLimit(400 * 400); // set the max size of the memory cache, default is 1M pixels (4MB) BitmapAjaxCallback.setMaxPixelLimit(2000000); }