background preloader

Android Development

Facebook Twitter

FXMisc/RichTextFX: Rich-text area for JavaFX. Архивы Программирование и БД. DatePickerDialog и TimePickerDialog. Google/ringdroid. Многозадачность в Android. Часть 2 - 7 шаблонов использования многопоточности в Android - ТехноБлог Пакало Евгения. 7.1: AsyncTask and AsyncTaskLoader · GitBook. How to update UI from background service – Anitaa Murthy. I spent a lot of time recently interviewing perspective candidates for an Android developer post and when asked on how to update an activity from a background service, a lot of people did not get it right.

How to update UI from background service – Anitaa Murthy

So I thought I would post a short article on some of the basic implementations of updating UI from background service. There are a lot of ways to do that but these are the 3 of the basic implementations and I personally feel that every android developer should be aware of it. Using LocalBroadcastReceivers From the official documentation, we know that LocalBroadcastReceivers are a: Helper to register for and send broadcasts of Intents to local objects within your process. This is efficient for a couple of reasons: You know that the data you are broadcasting won’t leave your app, so don’t need to worry about leaking private data.It is not possible for other applications to send these broadcasts to your app, so you don’t need to worry about having security holes they can exploit. That’s it! Шишки и грабли Android-разработчика за 2 года / Блог компании Edison. Я ясно помню тот день в далеком 2014 году, когда я решил заняться программирование под Android.

Шишки и грабли Android-разработчика за 2 года / Блог компании Edison

Это оказалось лучшим решением, которое я принял в моей жизни. Уже прошло почти два с половиной года, и за это время у меня возможность кое-чему научиться. Когда я только начал, я не знал никого, кто мог бы научить меня, показать, как правильно нужно делать. И я совершил МНОЖЕСТВО ошибок, в так же потратил кучу времени на то, чтобы потом их исправить. Полтора года спустя, мне выпал шанс поработать с очень талантливыми и опытными Android-разработчиками, которые направляли меня и помогли мне привести все в порядок.

И уже какое-то время я, как могу, стараюсь помогать другим разработчикам — прямо или косвенно. В этой статье я поделюсь некоторыми полезными фактами, до которых я сам дошел за эти годы. h6ah4i/android-advancedrecyclerview: RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting) Technical Blog of Android: Circular Seek Bar - Example. MyView.java package com.rakesh.androidcircularseekbar; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.RectF; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; public class MyView extends View { /** The context */ private Context mContext; /** The listener to listen for changes */ private OnSeekChangeListener mListener; /** The color of the progress ring */ private Paint circleColor; /** the color of the inside circle. /** The progress circle ring background */ private Paint circleRing; /** The angle of progress */ private int angle = 0; /** The start angle (12 O'clock */ private int startAngle = 270; /** The width of the progress ring */ private int barWidth = 5; /** The width of the view */ private int width; /** The height of the view */ private int height;

Technical Blog of Android: Circular Seek Bar - Example

Android Custom Floating Action Button Tutorial. Objective In this tutorial we learn how to create a Custom Floating Action Button and opens Menu List in Android Application through a simple example.

Android Custom Floating Action Button Tutorial

Floating Action Button is a component of Material Design Guide. Its a circular button basically used for special type promoted action. In this tutorial, we will implement Floating button and will open a menu list in an Android Application. When user clicks on the floating button, it displays a custom menu through which we can navigate to various activities. Step 2 Creating a new project. Clans/FloatingActionButton: Android Floating Action Button based on Material Design specification. Android Fragment Tutorial: Color Picker Dialog. By Daniel Salas - Last updated September 2016 Summary: Develop your own color picker dialog for Android mobile apps.

Android Fragment Tutorial: Color Picker Dialog

Learn how to work with colors in the Android development environment. Design your own re-usable color picker, or integrate the dialog available from this tutorial. Tutorial Contents: For design and coding guidance, we will refer to these resources: Android - How to create a color picker dialog. Tuesday, October 13, 2015.

android - How to create a color picker dialog

Drag and Swipe with RecyclerView — Part Two – Paul Burke. July 22, 2015 In Part One, we looked at ItemTouchHelper, and an implementation of ItemTouchHelper.Callback that adds basic drag & drop and swipe-to-dismiss to linear RecyclerView lists.

Drag and Swipe with RecyclerView — Part Two – Paul Burke

This article will expand on that example, adding support for grid layouts, “handle” initiated drags, indicating the selected view, and custom swipe animations. Drag Handles When designing a list that supports drag & drop, it’s common to include an affordance that initiates the drag on touch. This helps with discoverability and usability, and it’s recommended by the Material Guidelines when the list is in “edit mode”. First, update the item layout. The image used for the drag handle can be found in the Material Design Icons and was added using the handy Android Material Design Icon Generator Plugin.

As briefly mentioned in the last article, you can use ItemTouchHelper.startDrag(ViewHolder) to programmatically start a drag. We’ll need an interface to pass the event up the chain: and update RecyclerListAdapter: Drag and Swipe with RecyclerView – Paul Burke. There are many tutorials, libraries, and examples for implementing “drag & drop” and “swipe-to-dismiss” in Android, using RecyclerView.

Drag and Swipe with RecyclerView – Paul Burke

Most are still using the old View.OnDragListener, and Roman Nurik’s SwipeToDismiss approach, even though there are newer, and better, methods available. A few use the newer APIs, but often rely on GestureDetectors and onInterceptTouchEvent, or the implementation is complex. There’s actually a really simple way to add these features to RecyclerView.

It only requires one class, and it’s already part of the Android Support Library: ItemTouchHelper ItemTouchHelper is a powerful utility that takes care of everything you need to add both drag & drop and swipe-to-dismiss to your RecyclerView. Skip ahead Just interested in seeing the completed source? Setting up. Custom ProgressBar with text. Custom ProgressBar. Android default widget will cover most of the needs, but certain times we need to create your own custom widget.

Custom ProgressBar

You can do this by extending the View. In the above design you can see two circular progress bar spinning in sync with each other. It’s actually two arch rotating along with changing the sweep and start angle. Lets break this into different step.When we extend a View we need to override couple of methods, I’ll go through one by one. View Constructors As you can see I had overridden 3 constructors DualProgressView(Context context)->Called when it is created Programatically (new DualProgressView(this))DualProgressView(Context context, AttributeSet attrs) ->Called when view in inflated via XML. param attrs which contain collection of your attributes you passed via XML.DualProgressView(Context context, AttributeSet attrs, int defStyleAttr) ->this invoked manually to apply any default style you want to apply for your widget.

Measuring and Layout Drawing Animation find the code below. Drag and Swipe with RecyclerView — Part Two – Paul Burke.