Stream

הצטרף לקהילה הזו כדי לכתוב פוסט או תגובה.
המנחה הצמיד את הפוסט לחלק העליון של הזרם

Ian Lake
מנחה

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, rooting devices, 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:
Firebase: https://groups.google.com/forum/#!forum/firebase-talk
Android Beta: https://plus.google.com/communities/106765800802768335079
Android Studio: https://plus.google.com/communities/103491657963571270604
Developer Tools (Gradle, ProGuard, etc): https://plus.google.com/communities/114791428968349268860
Android Things/IoT: https://plus.google.com/communities/107507328426910012281
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 http://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.
 ·  תרגם
1150
115

Kishan Singh

Tools and Libraries  - 
 
Hi friends,

I am using com.google.android.gms.maps.MapFragment for google map in my fragment class but it is working fine in my device for api level 17 but in higher it is crashing. Can any one give me solution for this??

My code is like:-
// Obtain the MapFragment and get notified when the map is ready to be used.
MapFragment mapFragment = (MapFragment)getFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);

Thanks,
 ·  תרגם
1
הוסף תגובה...

Pavel poley

Help Center  - 
 
hello, i have a problem to start activity with shared elements from a activity with recycle view , when i click on recycle view item look like the the second activity start but return to the first activity, when i turn off the screen and turn on again , i see the second activity with my item on black background(dont know why)
in my adapter i make a new transition name to my shared element , i cheched the logs and the transition names look correct , in the second activity i settransitionname with name from the adapter.
some on face a problem like this?
 ·  תרגם
1
הוסף תגובה...

Abad Ullah

General Discussion  - 
 
We use
Intent intent = new Intent (ActivityA.this, ActivityB.class)
Why we use .class with ActivityB in explicit intent to call the other activity? instead of using ActivityB.java.
 ·  תרגם
1
תמונת הפרופיל של Abad Ullahתמונת הפרופיל של Christophe Beyls
8 תגובות
 
http://MyClass.class is a way to reference a class in code without instantiating an object from that class.
 ·  תרגם
הוסף תגובה...

Nagaraj N

Help Center  - 
 
Hi,

FCM, MyFirebaseInstanceIDService, onTokenRefresh() method is not getting called in emulators(using Nexus 5X Nougat version), followed FCM setup guide lines and all SDK packages are up to date. Any Idea why it is not working in emulators ? #askfirebase #android #FCM
 ·  תרגם
1
תמונת הפרופיל של Ian Lakeתמונת הפרופיל של Nagaraj N
2 תגובות
 
+Ian Lake Sure, Thanks for the info
 ·  תרגם
הוסף תגובה...

Prateek Varshney

Development Patterns  - 
 
A read on implementing a custom bottom navigation bar, why some famous apps still don't use Android's BottomNavigationView and more.
 ·  תרגם
The Facebook android app had been a trend-setter in one respect — the bottom navigation. They had boldly ported it from iOS and it made…
1
הוסף תגובה...

John Smith

Help Center  - 
 
Hi all, I'm developing an image gallery app. I'm using Retrofit to get the response, and loading them with Glide into a RV.

I want to be able to click on an image which would launch a DetailActivity showing the image that was clicked, without having to load it from its url with Glide, again. As that would require data connection, and it might take some time to display.





 ·  תרגם
3
תמונת הפרופיל של Christophe Beylsתמונת הפרופיל של John Smith
2 תגובות
 
+Christophe Beyls​ Thanks. :) I didn’t know.
 ·  תרגם
הוסף תגובה...

Zakir Maho

Help Center  - 
 
Hi; I'm using Qt for Android. I wonder how Qt - native java codes runs on Android? (I know there is QtAndroidExtras but I have to use pure jni.h) I want to jni.h with Qt for Android and I want to call Android SDK Java codes from C++ with jni.h in Qt. What should I know for this? Have you got examples for this? I wrote a jni code: https://paste.ubuntu.com/23816103/
This code is running for desktop console app, but same code is not running for Android. Can you help me? Thanks.
 ·  תרגם
#include //#include using namespace std; int main(int argc, char* argv[]) { JavaVM* jvm; JNIEnv* env; JavaVMInitArgs jvm_args; JavaVMOption options[1]; options[0].optionString = "-Djava.class.path=myclasses"; jvm_args.version = JNI_VERSION_1_2; jvm_args.options = options; ...
1
הוסף תגובה...

Kanj Narayan

General Discussion  - 
 
Here's something about the gradle build system that I discovered today-

If app has 2 modules- app and libAbc, both of which use an external library xyz, classes in both app & libAbc can use classes of xyz when xyz is a compile dependency in build.gradle of libAbc.
There is no need to add compile dependency on xyz in app's build.gradle too.

But what if you decide to use xyz only in debug (or any other) buildtype.
If you change compile dependency to debugCompile in libAbc's build.gradle, app module will no longer be able to use classes in xyz. Android studio will not show any indication for compile error but project build will fail due to compile error at import statements.
Now we must add debugCompile dependency on xyz in app's build.gradle as well. (Even though libAbc is still a compile dependency in app's build.gradle.)

Is this supposed to work like this or is it a bug in build system? I don't know.
 ·  תרגם
1
הוסף תגובה...

mohamed aniba

Help Center  - 
 
Hi,

I am writing an android library, which has init method with application context and some set, get methods.

Can i use singleton object or is there any other better way to write?

Please suggest.

Aniba.
 ·  תרגם
1
הוסף תגובה...
 
Whenever I start a. new project in Android Studio 2.2.3
A lot of warnings and errors are there In Main activity.Java
Also there are too much unresolved dependencies.... Can anyone help me
 ·  תרגם
1
תמונת הפרופיל של Mrunal Ahirrao
 
Those errors maybe in your code. 
 ·  תרגם
הוסף תגובה...
 
CLOSE ALERT WINDOW ISSUE:
I am using an alert window for a popup, similar to truecaller. I am listening for the ACTION_CLOSE_SYSTEM_DIALOGS broadcast to know when the home button is pressed to close the particular dialog. This works very well with software home button. For a physical home button (Similar to Home Button from Galaxy S series), this seems to be not working.
Actually it works great on Android 6.0 and above. But below Marshmallow the intent cannot be caught for physical home button press. Below is the code for my WindowManager.LayoutParms.

params = new WindowManager.LayoutParams();
params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
params.height = WindowManager.LayoutParams.MATCH_PARENT;
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.gravity = Gravity.TOP| Gravity.START;
params.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;

Just a normal window.
 ·  תרגם
2
הוסף תגובה...

נוצר על ידי

על הקהילה הזו

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

Jonathan I

Help Center  - 
 
Hi guys.
I need help to create the logic under a system.
Well, i am working with a recyclerview where all the items in it, have got a textview that is setted by the adapter by calling the setDistanza() method.
I would like to reorder the items by the getDistanza() method, i mean, i need to sort them by the ones with the getDistanza() that are nearest to 0.
I am not sure if i explained it well. If not, sorry for my english.
I hope Someone will help me.
Thanks.
 ·  תרגם
1
תמונת הפרופיל של Jonathan Iתמונת הפרופיל של Christophe Beyls
5 תגובות
 
I have no idea of what you want to achieve, I just give you trails to follow 
 ·  תרגם
הוסף תגובה...
 
I am creating a custom ViewGroup. How can I set or get margins of child in the custom ViewGroup onLayout() method?


@Override
protected void onLayout(boolean b, int left, int top, int right, int bottom) {
int count = getChildCount();
mMaximumHeight = 0;
//int width = 0;
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
child.measure(0, 0);
ViewGroup.LayoutParams params = (LayoutParams) child.getLayoutParams();
child.requestLayout();
child.layout(0, mMaximumHeight, params.width, mMaximumHeight + params.height);
mChildHeight = mChildHeight > params.height ? mChildHeight : params.height + child.getPaddingTop()+child.getPaddingBottom();//+params.topMargin+params.bottomMargin;
mMaximumHeight += (mChildHeight)+child.getPaddingBottom()+child.getPaddingTop();//+params.bottomMargin+params.topMargin;
//width = width > params.width ? width : params.width;
}
scrollTo(getScrollX(),getScrollY());
}
 ·  תרגם
1
תמונת הפרופיל של SanthoshKumar SrikanthaMuraliתמונת הפרופיל של Christophe Beyls
2 תגובות
 
I don't understand what you're trying to achieve and I see no code setting margins here, but calling requestLayout() inside onLayout() is probably a bad idea, like measuring during layout.

You are supposed to measure everything in onMeasure(). You can override onMeasure() and after calling super.onMeasure() you can call getMeasuredWidth()/Height() on the ViewGroup or the child views.
Then you can change these by calling setMeasuredDimensions() if needed.
Also don't forget that the value of LayoutParams.width and LayoutParams.height may be -1 or -2 (match_parent or wrap_content) instead of a dimension.
 ·  תרגם
הוסף תגובה...

Danish Amjad

Help Center  - 
 
I need to know how can we use DiffUtil notifyItemChange?
In my case just the current view is changed.
 ·  תרגם
1
תמונת הפרופיל של Christophe Beylsתמונת הפרופיל של Danish Amjad
4 תגובות
 ·  תרגם
הוסף תגובה...
 
Hi

I was wondering if there's a way to change design's library Floating Action Button size, programmatically...

It has a .setSize() method, but I think it only "accepts" either SIZE_MINI, SIZE_NORMAL or SIZE_AUTO

Thanks in advance.
 ·  תרגם
4
1
תמונת הפרופיל של Jahir Fiquitiva
5 תגובות
 
+Christophe Beyls
It is clickable. And sorry, I thought you could know what it is or guess it.
Thanks for the reply anyways.

+Ian Lake
Ok, thanks for the reply.
 ·  תרגם
הוסף תגובה...

Clive Sargeant

General Discussion  - 
 
Improve your apps chances of being found on Google Play
 ·  תרגם
2
1
הוסף תגובה...

Waad Al Katheri

General Discussion  - 
 
I have questions about retrofit.. If retrofit 2 library convert data to json automatically ..why use Gson library her ?
https://www.google.com/amp/s/onelonecoder.wordpress.com/2015/04/16/andorid-restful-client-using-retrofit-gson/amp/?client=safari
 ·  תרגם
3
1
תמונת הפרופיל של Waad Al Katheriתמונת הפרופיל של Christophe Beyls
3 תגובות
 
+Waad Al Katheri​ Gson can read and write JSON from/to any InputStream or OutputStream. Retrofit uses Gson (or any lib you want) to read JSON from Http streams.
 ·  תרגם
הוסף תגובה...

Adam Murray

Help Center  - 
 
Hi everyone, I'm trying to write an app that reads HTML from a news site, extracts elements of a story (heading, body, etc blo ks defined in CSS maybe) then collates info in to cards ordered in the same way as on the website.
Is it WebView or a parsing technique? So far the examples I've seen just pull the whole sites text, I'm only after specific parts of it.
An example of this would be the Sweet Aussie Deals app which pulls its info from ozbargain.com.au.
Thanks
 ·  תרגם
1
הוסף תגובה...

Mohamed Fadel

Help Center  - 
 
is that using ViewTreeObserver() listeners to indicate the layout had been completely drawn on the screen is the correct way?

as in documentation i quote:
" ViewTreeObserver should never be instantiated by applications as it is provided by the views hierarchy"

So is it optimal way or there's another way?
 ·  תרגם
1
תמונת הפרופיל של Mohamed Fadel
2 תגובות
 
thnx for help
 ·  תרגם
הוסף תגובה...