Are there libraries for android custom views? Re-usable components?
I did not found much on that topic. Just see everybody creates his own custom components, drawables and so on. Especially things like a homescreen-like viewswitcher and things like that, which reoccur often would be nice to have in a library.
You should check:
What Android 3rd-party libraries are there?
Android: how can i improve the look of an app?
You can put them into an Android Library Project. Here how to use them in Eclipse.
Related
I'm making an app in Xamarin Android and I want to achieve something like this:
https://github.com/Q42/AndroidScrollingImageView
Basically, it's an infinite scrolling image animation. I'm really new to android development let alone Xamarin so I'm at a loss here. I dont think the Translate animation in XML would work here. I'm thinking of translating 2 ImageViews but I dont know how to do that outside XML.
Is there a library similar to that one for Xamarin? Thanks in advance!
The cool thing about Xamarin.Android is that you can easily reuse existing Java libraries. If you are fine with using the AndroidScrollingImageView library instead of rolling out your own implemenetation, here's what you should do:
Clone or download the project to your own computer and build the library.
As a result, you'll get a JAR file that contains the AndroidScrollingImageView control.
Create a new binding project and import the JAR file.
Xamarin.Android wraps the library with C# wrappers so you can invoke Java code from C#.
Now you can use the control in your AXML layouts and call the methods in code.
It's worth reading the binding article to understand how this works. There's also a good binding library example here, where James Montemagno does exactly what you want to do. You might want to study it to see how the binding works in real life.
Is there a way to use a similar Framework as materializecss to Design Android Apps?
Or apply CSS to my design in an Android App?
In Android you must target to 5.0 and use elements like "toolbar", "palette", between others.
On github you have: https://github.com/wasabeef/awesome-android-ui/blob/master/pages/Material.md with dozens of material design elements, widgets, etc and most of them from Android 2.3+. Those are really easy to use and most of them only need a gradler declaration.
Hope that helps you.
Recently I'm studying the usage of the appcompat support library and the design support library. And I met a strange question(at least for me) that I can't understand.
In the appcompat support library, there're several AppCompat* like components, such as AppCompatButton, AppCompatCheckBox... There's one same thing among these components - In the official doc all these components have such illustration,
This will automatically be used when you use Button in your layouts.
You should only need to manually use this class when writing custom
views.
or something like this.
Here come's the question. Since Button isn't AppCompatButton, how can it consider it as AppCompatButton when I use Button during the xml or created in code? How does it work?
Forgive my Cantonese English.
Short brief on how the AppComp decided which class to init -
When using the support library (AppCompat) using the support library widgets (e.g. android,support.v4.widget.Button) ,the library will use the appropriate implementation based on your Android OS.
For example ,if your OS support Button it will use the native implementation ,else it will use the AppCompat implementation.
In other words ,it defers to run time to decide what to use..
I assume this is the automatically part..
I have two Android apps with different icon and color themes but that share the same activities, layout and logic. Any idea how to manage these apps? It would be counter-productive to duplicate the logic and layouts. There should be only one instance of layout, logic, etc.
this is the perfect scenario for using an Android library project.
Use your project as library (check the properties) and let the two implementing projects use that library.
You can re-use code and resources like layouts, images etc. across multiple applications using a library project, linked to from your different customised projects.
In Android Studio, you can harness the power of the gradle build system and easily create a solution for your problem. Check out http://tulipemoutarde.be/2013/10/06/gradle-build-variants-for-your-android-project.html
How can I reuse code AND resources in several applications? I have a fairly large code base (including resources) that I want to reuse i several applications. How can I do that?
I did try to use the Android Library concept (http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject) but never got it to work in Android 1.x
I'm amazed by the lack of information on the subject. It seems like Google has aimed Android development at pet projects and not real development. Variant handling should have been solved ages ago.
I've faced this issue. Android doesn't really lend itself to 'template' style development because the frameworks are relatively immature and the nature of the development is so wide ranging, however, these are some steps I've taken:
Create a library of common resources - I have generic XML files ready to go that support things like checkbox lists, context menus and dialogs.
Create some generic APIs for things like service bindings
Wrap common functionality into components - I've written my own location wrapper for example.
Note: I assume you mean reuse outside of SCM.