Stream

Join this community to post or comment
Pinned by moderator

Ian Lake
moderator

Meta  - 
 
Community Guidelines
Welcome to the official Android Development community on Google+. This community is a place where all Android developers can help one another, share resources, and make us all better developers.

However, that means that this is not the appropriate place for certain types of posts:
- Spam
- Soliciting
- Recruiting
- Promotional posts
- ROM, theme, and icon pack development
- Posts about new devices, system updates, etc
- Posts without any text
Posts of this nature may be removed without warning or result in being banned from the community.

In addition, there are a number of other official communities for certain topics:
Android App Design (Visual design help and design feedback) : https://plus.google.com/communities/116667001535376136065
Android Studio: https://plus.google.com/communities/103491657963571270604
Developer Tools (Gradle, ProGuard, etc): https://plus.google.com/communities/114791428968349268860
Android M Developer Preview: https://plus.google.com/communities/107145370812485315862
Android Wear: https://plus.google.com/communities/113381227473021565406
Android TV: https://plus.google.com/communities/112881895888889393129
Android Auto: https://plus.google.com/communities/116320632775523824083
Google Cast: https://plus.google.com/communities/115742157569103585450
Google Fit: https://plus.google.com/communities/103314459667402704958

Here’s an overview of some of the specific categories available:

Help Center
Running into issues? Here’s where to post. If you’re having implementation problems, consider posting a link to a stackoverflow.com question with your code and any logcat errors. If you’re trying to find the right approach to a problem, consider searching for resources first: you’ll be a lot more successful saying “I’m looking at library Y to implement Z in my app. Is that the best way to do it?’ compared to “How do I do Z?”

Development Patterns
The various APIs give you the building blocks you need to build awesome apps. Development patterns are the instructions on how to assemble those building blocks. Guides, tips, and gotchas all belong here!

Tools and Libraries
Have a favorite tool or library that has saved you time and effort? Share it with the community!

Open Source Apps
One of the only things better than finding an awesome interaction pattern or functionality in an app is finding out exactly how they did it. Make sure you include a link to the source code when posting your favorite open source apps here.
153
23
Phuket Office (Blogger)'s profile photoBeejune Liew's profile photo

Allan Zhang

Tools and Libraries  - 
 
This question deals somewhat with Android's source code, but I'll give it a shot here. 

One of the spell checkers that I have really admired is Android's own Spell Checker Framework, and I would like to make a open-source module of this framework for iOS so mobile developers to could drop it into their applications (just as many web or application developers's would easily drop in something like Hunspell).

In browsing the source code, my impression is that a lot of the heavy lifting is done by android.view.textservice.SuggestionsInfo

However, examining this framework shows not much logic code in terms of performing the actual spell checking. Any associated dictionaries (which are needed in the case of Hunspell or Lucene) also are not referenced. Am I missing something?

Any help is much appreciated, thanks!
android.service.textservice.SpellCheckerService - SpellCheckerService provides an abstract base class for a spell checker
1
Add a comment...

Uddyami Agrawal

Help Center  - 
 
Has anyone used  J2v8 for JavaScript binding. I need to bind some business rule functionality  from js file in my application. I am contemplating between J2v8 vs rhino
2
Moritz Post's profile photo
 
I would go with J2V8. The performance an JS language feature set is much better than in rhino.
Add a comment...

John Doe

General Discussion  - 
 
A worth post about the Doze/App standby mess.
1
Ian Lake's profile photoSteven L.'s profile photo
9 comments
 
+Ian Lake Ah, interesting, I haven't noticed that one before.  Thanks :)

That said: the documentation for that method mentions nothing about doze mode exemptions.  And since it's for an older API, I wouldn't expect it to be exempt (without it being documented).  And does "exempt" imply you have unrestricted device capabilities, or is e.g. networking still disabled?

The training for alarms doesn't mention setAlarmClock at all: https://developer.android.com/training/scheduling/alarms.html

There's an AlarmClock provider class from APIv9 ( http://developer.android.com/reference/android/provider/AlarmClock.html ), but AlarmManager#setAlarmClock is APIv21 (and it doesn't use AlarmClock at all): http://developer.android.com/reference/android/app/AlarmManager.html#setAlarmClock%28android.app.AlarmManager.AlarmClockInfo,%20android.app.PendingIntent%29 .  How are we to know they're different, except that setAlarmClock doesn't seem to require the SET_ALARM permission?  Which should we use, and when?  (are they different? setAlarmClock and related methods seem to imply alarm-clock-apps will be able to retrieve and modify your intents, like what I would expect from the AlarmClock provider)

I have no idea how I would be expected to know which to use for time-sensitive work, except that the documentation seems to imply that I'd use `setExact()` with wakeup is the only real option.  Unless I'm missing some more-prominent documentation, this seems like a really large (and important) gap.
Add a comment...

Stefano Rizzini

Help Center  - 
 
Hi everybody, I'm a beginner and I'm facing a big (for me) problem.
I'm working on a medical app.
My app has 3 tabs, and each tab is made by a fragment.
In each fragment I want to put a different list of diseases (for example: adult diseases in the first tab, pediatric deseases in the second tab, and so on), so clicking a single disease I will be able to open a second activity with other informations.
The problem is: I am not able to put a recyclerview (or at least a listview) in each fragment.
I've searched for tutorials and examples, but I can't find the right way to do it.
Anyone can help me?
Thanks!
3
Stefano Rizzini's profile photo
7 comments
 
+Christophe Beyls the cheesesquare example is very similar to what I'm looking for, but I want view a non-random list of diseases. I've create a string with all the titlea in alphabetic order, and I would like to show them in that exact order
Add a comment...

Robert Thorpe

Tools and Libraries  - 
 
Curated list of awesome Android libraries and resources :)

Ranging from JSON to images.

https://android-libraries.zeef.com/jurgen.stumpp
5
3
anhtung dao's profile photo김현준's profile photoMark Stevens's profile photoJavier Pinedo's profile photo
Add a comment...

Kent Davies

Help Center  - 
1
Christophe Beyls's profile photoTyler Chesley's profile photo
4 comments
 
+Christophe Beyls ​right, I just question whether it truly mimics the behavior we're trying to test. There could be peculiarities that wouldn't show up in a real world scenario. Might beat your head against a wall and find out it's a bug in Android. I've done that a few times. It's worth checking the android bug tracker to see is all
Add a comment...

licco wee

General Discussion  - 
 
Anyone know is there a good open source for "Image Pan Zoom" library?
Thanks :)
1
bryce hendrix's profile photo
3 comments
 
I've used the one +Edwin van Ouwerkerk Moria​ suggested as well and it worked great. I've used a few others and written one myself, but that one is the best of the lot.
Add a comment...

Mobile Application Tutorials

Development Patterns  - 
 
Wife learns android programming - Test 1 review

Hi Guys

In this tutorial we review the questions and provide the answers to last episode's exam.

Cheers

#androiddev   #androidapps   #appdevelopment  
3
1
Vladimir Bjelakovic's profile photo
Add a comment...

Willie Huang

General Discussion  - 
 
1. If you want to change elevation dynamically, you should call setMaxCardElevation(float) when CardView is initialized.
public void setMaxCardElevation (float radius) : Updates the backward compatible elevation of the CardView. Calling this method has no effect if device OS version is L or newer and getUseCompatPadding() is false. (from https://developer.android.com/reference/android/support/v7/widget/CardView.html)

2. To create a card with a shadow, use the card_view:cardElevation attribute. CardView uses real elevation and dynamic shadows on Android 5.0 (API level 21) and above and falls back to a programmatic shadow implementation on earlier versions. (from https://developer.android.com/training/material/lists-cards.html)

3. In Maintaining Compatibility, it says “However, you can design your apps to make use of these features when running on devices that support material design and still be compatible with devices running previous releases of Android.” (from https://developer.android.com/training/material/compatibility.html)

4. public void setUseCompatPadding (boolean useCompatPadding) : CardView adds additional padding to draw shadows on platforms before L. useCompatPadding is True if CardView should add padding for the shadows on platforms L and above. (from https://developer.android.com/reference/android/support/v7/widget/CardView.html#setUseCompatPadding(boolean))

In #1, it says Calling the method which changes elevation dynamically has no effect if device OS version is L or newer and getUseCompatPadding() is false, but in #2, it says CardView uses real elevation and dynamic shadows on Android 5.0 (API level 21) and above. It seems that they conflict with each other. What do they mean ?

In #3, does it mean I can design my apps to make use of these material design features if I run my app on devices that support material design and these features are still compatible with devices running previous releases of Android ?

In #4, what does it mean ? Why does it say "before L", not "after L" ?

Could someone explain it ?
Thank you.
1
Andhie Wong's profile photo
 
#2 First  you need to understand that, on 21+, shadow is added by the OS, so CardView will not do anything extra to draw shadow. To create a shadow <21, CardView will to draw its own shadow via onDraw(). 

#1 The CardView need to have a maxCardElevation in order to know how much space it needs to pad its content and draw its shadow size correctly. This is not a concern on 21+ as shadows are not drawn by CardView, Unless you set useCardCompatPadding="true"

#3 #4,  Due to this padding, your Card UI will look differently on <21 (smaller) and 21+. If you want your UI to look the same in all versions, you need to set useCardCompatPadding="true" which will also force CardView to pad itself on 21+
Add a comment...

whs.su

Tools and Libraries  - 
1
1
arvin z's profile photowhs.su's profile photo
2 comments
whs.su
 
+arvin z example depends on what you need.
for simple "ImageViewWithAnimation" exists other solutions.
Code from OP may be used for develop custom view. AssetGifDrawable just demo - how to implement methods - one returns just first frame of gif, and second - load full animation when start() called. 
You can see wATL demo code - how  AssetGifDrawable instantiated - https://github.com/suwhs/wATL/blob/master/app/src/main/java/su/whs/watl/samples/ContentLoader.java . And your view must known how to work with that drawables (set Drawable.Callback) and propertly handle it)
Add a comment...

About this community

Welcome to the official Android Development community. This community is a place where all Android developers can help one another, share resources, and make us all better developers. Please read the community guidelines before posting: https://plus.google.com/+IanLake/posts/Rqtqo4x7hv6

pavan p

General Discussion  - 
 
Hi,

I am trying to parse JSON data using GSON library
[network calls made using volley library]

json data : http://pastebin.com/sZeHZcHf

my code : http://pastebin.com/sZeHZcHf

Thanks for any help !!
1
Add a comment...
 
Hey guys,
I am looking for a library that implements a Directory Chooser (mainly the GUI). Sadly aFileChooser is no longer really supported or maintained. Is there any popular library that accomplishs that or does a similiar job ? My minimum SDK is currently 15. 

Thanks for your advice, in advance!

Pretty sad that there is no real official API for that yet, or am I overlooking something?
1
Chris P's profile photoClemens Schartmüller's profile photo
5 comments
 
I just spotted it. Open Directory is indeed available, but sadly only to Android 5.0 and above. I'd love to go down to 4.0.3 ..
Add a comment...

Darius Radius

Help Center  - 
 
Hello, I have problem with greenrobot eventbus, more information here. Thank you very much. D
http://stackoverflow.com/questions/32402080/greenrobot-eventbus-holds-variables
1
Darius Radius's profile photo
3 comments
 
Done.
Add a comment...

Yannick Lemin

Development Patterns  - 
 
Guys I need your help to make a decision. 

Very tiny background: I'm redoing a core library with a focus on performance, size and code cleanliness.

As a Java programmer, I've had this old habit to use apache commons.lang library in pretty much all my projects, even since I started working on Android a while ago. 
The current project I am working on is dex sensitive and I am afraid that using commons.lang or guava will be too much. I mainly use StringUtils, and the Equals, HashCode and StringBuilder classes from this library.

My question is the following: 
Should I either
- keep using it, it's not going to be too big for the dex?
- extract what I want in my own project and keep only what I need?
- do my own?
- something else?

What do you guys think? Thanks a bunch in advance for any help you could provide :)

P.S. I'm trying to avoid proguard as it slows down the build time, and it is a library and that config will to be propagated to all the apps.
1
Yannick Lemin's profile photoChristophe Beyls's profile photo
3 comments
 
Also, the Android framework and the support libraries include many utility classes; some of them may overlap with Guava and Commons lang. For example: TextUtils.isEmpty() or you can use the framework's StringBuilder instead of StrBuilder.
Add a comment...

Josh Gray

General Discussion  - 
 
 
Sweet, a tool for helping create 'morphable' shape animations by +Stefano Bonetta!

https://github.com/bonnyfone/vectalign

When animating the pathData between two shapes, AnimatedVectorDrawable requires that the start and end images use the same type and number of drawing commands, this tool helps you to create/massage shapes to be compatible.

#AndroidDev  
6
1
김현준's profile photo
Add a comment...

Sergey Litvinenko

Help Center  - 
 
Hello, anybody know how to implement Expandable Cursor RecyclerView ?
1
Add a comment...

Alan Shore

Tools and Libraries  - 
 
 
SwitchMe 2.0 - Material Design has arrived!

An app that allows you to boot multiple copies of your current OS, each with its own apps, data and system settings.

And its now completely free. Get it directly from my Google Drive if youre not one of the 20% already part of the staged rollout:

https://drive.google.com/file/d/0B-7NkxnmQ8SHelA2QVp0NFBrYzA/view?usp=sharing
1
Add a comment...
 
Okay, I am having a very strange problem. For some reason, on tablets, my Floating Action Button is a squere, but on phones, it is round as intended. Any help for this?
Library: https://github.com/makovkastar/FloatingActionButton Code: 

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"

        android:layout_width="match_parent"
        android:layout_height="match_parent">


        <com.melnykov.fab.FloatingActionButton
            xmlns:fab="http://schemas.android.com/apk/res-auto"
            android:id="@+id/camFab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="16dp"
            android:onClick="camFab"
            android:src="@drawable/ic_action_add_white"/>
    </FrameLayout>
FloatingActionButton - Android floating action button
1
Jason Hall (Imheroldman)'s profile photoMarlon “Virus” Jones's profile photo
3 comments
 
I'll try thst. Thanks. 
Add a comment...