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.
107
20
김경철's profile photo김경철's profile photo

Bogdan Zurac

General Discussion  - 
 
I was thinking... Why isn't there a Developer Console Android app? I know we can use the mobile version of the website, as it has a responsive design. But it's not the same thing. +Ian Lake​ have you guys considered creating an Android app for this purpose? If not, can you forward this request/suggestion towards the management responsible for these sort of issues? Thanks!
1
Add a comment...

djougue basso

Help Center  - 
 
I have created an android application (let us call it cecile),

when i launch this application (when cecile become active), i switch to any other application (may be web browser, google...) and work within this apps, suddenly the application that i have created (cecile) suddenly move from background to foreground. I don't know what i did (may be the pushNotification )that cause this unexpected behaviour in my own application (the behaviour of moving my active application suddenly from background to foreground without i am clicking on).

Someone has any idea about this bug?
1
Neo Elit's profile photoRaymond Cool (stainlessray)'s profile photo
2 comments
Add a comment...

Dimitri CHARLES

Development Patterns  - 
 
Just a simple basic question, if you get articles that contain images (like a NewsReader app) and add them in a listView, do we have to resize the images article based on the screen density? I need some clarification here? Thx for your answer
1
François Blavoet's profile photoDimitri CHARLES's profile photo
2 comments
 
Hi François, thx for your reply. I am already using Glide for loading the images. How can I correctly resize the images based on screen density? For instance, If I have an image of 56x56dp in mdpi, how to scale it hdpi, xhdpi, etc? What are the correct dimensions? I know that hdpi = 1.5 * mdpi, xhdpi = 2 * mdpi but for now the result is not great.



Sorry if my questions seems silly, this is my first android app.  
Add a comment...

Abhimanyu Aryan

Help Center  - 
 
Are SDK bundles same for Windows,Linux,Mac? Is it just the tool(IDE) and location of SDK that matters? 
1
Add a comment...

Kartheeki Jampana

Help Center  - 
 
HI,  All.
Is there any way to know the  postpaid bill amount from android phone.
I know There is no API to access that sort of information from the SIM card in Android.  Any one suggest me is there any way to know the postpaid bill amount from phone.
3
Kartheeki Jampana's profile photoKarthik Pai's profile photo
5 comments
 
That's not possible. Sorry.
Add a comment...

Mobile Application Tutorials

Development Patterns  - 
 
New tutorial series - How to use android camera2 API's

Hi Guys

Just starting a new tutorial series on the camera2 api's.
Part 1 is about getting started with the look & feel of the app.

Cheers
4
3
Marcel Ulbrich's profile photoPaul Labedan's profile photo
Add a comment...

Desonte Jolivet

Help Center  - 
 
So I've successfully used the GoogleApiClient for Google+ login object and implemented the GoogleApiClient.ConnectionCallbacks and GoogleApiClient.OnConnectionFailedListener interfaces. Although within the doc it describes building this object within each Activity, my question is, "Should i create a static class to handle Google+ login are do it in each Activity.
3
2
Patrick H's profile photoDesonte Jolivet's profile photoDarryl Moering's profile photoZoltán Gönczi's profile photo
2 comments
 
Makes sense and seem fair enough. In the docs it reads:

"You should instantiate a client object in your Activity's onCreate(Bundle) method and then call connect() in onStart() and disconnect() in onStop(), regardless of the state."

Also the reason Im using Google+ is just so I dont have to deal with user password/login i'm getting the idToken and passing it to my backend

https://developers.google.com/identity/sign-in/android/backend-auth#send-the-id-token-to-your-server

So I'm just trying to figure out the best way, to keep a valid idToken.
Add a comment...
 
Does any one know the policy for content subscriptions via Google Play store? Does google take a % of the subscription revenue? I haven't used in-app billing before.
1
Chris Pick's profile photoEmmanuel Astier's profile photo
4 comments
 
On Hearthstone ( the blizzard game ), the packs are more expensive when bough from phones than from the desktop versions because of that.
http://us.battle.net/hearthstone/en/forum/topic/12372437538
Add a comment...

Chop Labalagun

General Discussion  - 
 
Hi Quick question.
I am using the Equalizer library from android (android.media.audiofx) and you can get all the supported bands from each device but my question is How do i know which band belongs to which frequency?
1
Add a comment...

lalit vasan

Development Patterns  - 
 
I am an Android Developer , i love writing blog . So Purpose of writing this blog is to sharing my knowledge to others . Here you can find the code chunks that can help to solve your problem while developing android apps. so please share the blog that other can gain , and to make me success in my vision of knowledge sharing  
1
1
Dany Fradika's profile photo
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

mehdi akbarian

Help Center  - 
 
Hi buddies
Im working on an android application that have a multiple database table ,num1 table, num2 tabel &... And in a same time(every 3sec) i read&write data from different table!!one cursor for num1 table and another for num2!i got "Found multiple library tables, ignoring..." and "a sql obj foe database X was leaked plz fix your application to end transctions in..." warnings!!what should i doto solve this??
(sorry for bad en)
1
mehdi akbarian's profile photoChristophe Beyls's profile photo
7 comments
 
Maybe your code calls SQLiteDatabase.beginTransaction() without a matching call to SQLiteDatabase.endTransaction() at the end.
Add a comment...

Tushar Gogna

Help Center  - 
 
Hello team, I am facing a problem using Facebook share with "ShareLinkContent". After successfully sharing the post.. I get the default toast "You shared this post.". I want to override that toast message. How can I do it? Thanks in advance. 
1
Add a comment...

Abhimanyu Aryan

Help Center  - 
 
How to create android Documentation from source code like we do in java

package/subpackage/$ javadoc *.java
1
1
Mike Wolfson's profile photoMuhamad Faisol Faisol's profile photo
 
It is exactly the same.  Android uses Java as its base language - just annotate your methods with Javadoc, and you will be able to generate the docs the same way.  Bottom line Android is just like Java in this case.
Add a comment...

Stefan M.

Help Center  - 
 
Currently we are using greenrobots EventBus [0] for sending events to other classes (e.g. Activites and Fragments). This works fine and all is good.
Today I found LocalBroadcastManager [1] which is in my stupid eyes the "sam". It sends a ObserverPattern-Like message which include an Intent (which can include an Bundle :D).

In love to use "out of the box" classes and frameworks. So my wish is to replaced greenrobot with LocalBroadcastManager. 
My question:
Have anyone expirience with that? Or use eventbus too and love this because of.... :)
Why Observer-Pattern Frameworks like greenrobot or Otto exists? Why no one would use (Local)BroadcastManager?

[0] https://github.com/greenrobot/EventBus
[1] http://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager.html
EventBus - Android optimized event bus that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
4
1
Karl Heimann's profile photoPaul Danyliuk (Actine)'s profile photoStefano Rizzini's profile photo
3 comments
 
Haven't used GreenRobot's EventBus, but in the framework I once developed for web automation I implemented such mediator-based event bus so that components could speak to each other like fragments in Android. Guess what, when I was leaving, I advised to eventually rewrite that with callback interfaces (again, like it is advised with fragments).

To my knowledge, pros of event buses are that they are easier to code and don't require parceling/unparceling data unlike Bundle-based LocalBroadcasts. The cons of both is that they lead to extreme code decoupling, i.e. it is hard to determine what the execution flow will be, and you have to keep track of your dispatchers and listeners to know what's going to be called when. Also you have to take care of registering/unregistering listeners yourself.

There's a third option that you may consider for maximum performance versus ease to plug and use: simply having a singleton in the system where you store the data you wish to transfer between components, supporting observers if required. You can have it just for your needs without all-purposefulness bloat. That's something I plan to use.
Add a comment...
 
Hey guys, need ur help...
I am developing this new app in which I am displaying a list of items (textviews), the scenario is, I want to display more than 100 entries in it such that each of them will have a different font setting as shown below,

Item 1 (roboto-regular)
Item 2 (roboto-medium)
Item 3 (roboto-bold)
Item 4 (roboto-regular)
Item 5 (roboto-medium)
Item 6 (roboto-bold)
And so on...
How can I achieve this?? Different fonts in a ListView.
If u have a SO link, plz share here
1
Abhishek Mhatre (aB9)'s profile photo
4 comments
 
+Alex Tern​ thnx 😊
Add a comment...

Adrian Vovk

Help Center  - 
 
I need help with the IAP API. I tried copying the file and building but it never generates a .java file. I just copy-pasted the code inta a .java file and it worked but I can't call IInAppPurchaseService.Stub.asInterface(service) in the service connection because Stub isn't a thing! Please help I need IAP (for donations) to work
1
Add a comment...

Bunhann Thou

General Discussion  - 
 
Hi, All.

I have a question in sharing data of an application between 2 devices in android.
I have 2 devices which do not have internet connection but i want to share data between 2 devices. Please look at my picture to understand more.
Device A: Running an application which an entry activity. Each entry data will be store in sqlte in device A.
Device B: Running same application. But this device will use result activity. So, i want data from device A come to device B without internet connection.
Is there anyway to share data between device?
1
1
Sachin Shelke's profile photoMatt Kraus's profile photoZoltán Gönczi's profile photo
12 comments
 
In #CrypSafe  both devices are on WiFi, we open a socket and use OkHttp with RESTful services to mirror the SQLite database. I'm liking the WiFi direct idea.
Add a comment...

Krishnaraj J

Development Patterns  - 
2
1
Ian Lake's profile photoRavikumar S's profile photo
 
Why would you need to do any of that? You should really be overriding http://developer.android.com/reference/android/support/v4/view/PagerAdapter.html#getItemPosition(java.lang.Object) to update your PagerAdapter with the new Fragment.

Pages that haven't changed return PagerAdapter.POSITION_UNCHANGED, the Fragment that is removed returns PagerAdapter.POSITION_NONE, and the new Fragment gets its new position.
Add a comment...

Abhimanyu Aryan

Help Center  - 
 
why does Context(I know its top level class but exactly why we pass reference to context) refers to? when creating button or relativelayout 

protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    RelativeLayout rl = new RelativeLayout(this);
    Button btn = new Button(this);
 }
public Button(Context cxt); // public constructor with button class
1
Clive Sargeant's profile photoAbhimanyu Aryan's profile photo
4 comments
 
+Clive Sargeant​ thanks a lot but

I saw context classes's source code but cmd+enter going up up up :)....is this still required?

MainActivity>@Deprecated ActionBarActivity>AppCompatActivity>FragmentActivity>Activity>ContextThemeWrapper>ContextWrapper>Context>
Add a comment...