Do Android UI Fragments work with Google Glass? I'm looking into improving the responsiveness of a Google Glass app. Does general Android Fragment patterns work with Google Glass?
-
All I could find related to this topic is on this [post](https://code.google.com/p/google-glass-api/issues/detail?id=343). It seems that even if you use Immersions it is not recommended to use `Fragments` – Emmanuel Aug 23 '14 at 00:24
1 Answers
The introduction of fragments within Android largely came out of the desire to have better tablet support. Fragments allow portions of the UI to be slightly more modular in ways previously cumbersome with the standard activity model.
A fragment is not necessarily a heavyweight component, but rather a "smarter" ViewGroup. For this reason, there is no technical limitation when using fragments with Glass and overall should not directly impact performance. In general though it is a good idea to make your view hierarchy as simple as possible so if you do not need your layout wrapped in a fragment, it is going to be optimal to leave it out.
So in general, if you are porting an existing app to Glass that already uses fragments, it shouldn't be a requirement to remove them. If you are starting a Glass app from scratch, there isn't a hard reason to use fragments, so stick with standard activities only (unless of course you have a strong preference to use fragments, then go for it).

- 206
- 1
- 2