I have jar library that developers can integrate in their Android app. The problem is that developers update my library very rarely, for example once in a year. For that time may not work due to new Android version, or I found critical bug after integration in my library.
Is it possible that library can update itself without update an APK?
Something like using downloadable jar or dex file.
Related
I'm really new with android developing. But I know how to upload a library to GitHub and include it in an android project. Recently, I'm working on some android apps, and I realized that I need to use some layouts and classes for all the apps. So, I created an android library and kept that inside all the project files. Then I came to know that I can simply upload that library to GitHub and use it for all the projects. But I'm not sure if it's a good idea. Is there any advantage if I upload it to GitHub?
In general, using a source control (git or other ones) is always a good idea given that your local filesystem can crash or you may want to revisit certain revisions you made to your project. Github is very popular and hosts several highly used projects, so it is no doubt a good place to upload. However, you must know that if you don't have their paid account, the project will be public (at this time, free accounts don't have a way to create private projects). Are you developing as hobby and do you mind if others see / take the code and reuse (hopefully under the licensing terms you specify)? Or is that something you're doing for an employer? In that case you should consult with the employer if this is OK.
Now as for sharing this module across projects, I don't think github has a secret sauce here. You could always build your library once and drop it in as dependency into all your apps, without having to copy its source code into each project. You may also want to look into integration with maven / gradle build systems, which Android Studio uses. For example, third party libraries often are available as downloadable libraries from maven central, and you can add a couple of lines to your build.gradle to go fetch a specific version of your library from maven central, rather than manually adding that library jar to the project that is using it. If your library code is on github, there are ways to publish to maven central from github ( http://datumedge.blogspot.com/2012/05/publishing-from-github-to-maven-central.html ) but I don't have experience with that step.
I am working on an Android project that needs three versions of the same application (for example: Admin version, User version, Custom version). I have already created a Google-App-Engine endpoints backend in the User version of the app. I have to start working on the other two versions now and I want to connect these two versions to the backend I created in the User version. I have tried finding the answer to this on the internet but I haven't been successful in doing so. I believe it is possible to connect the other versions of the app to the backend by importing the endpoint libraries from the cloud into the android projects somehow but I haven't been able to find a way to do so yet.
I did come across a way to import an existing module in the Android project but if I do that, then any time when I make changes to the backend in the "User" version, I will have to re-import the module in other versions of the app. I am so lost and confused.
Any help will be deeply appreciated.
Thank you!
After you build your cloud module there is a YOUR_CLOUD_MODULE_NAME-android-endpoints.jar under YOUR_CLOUD_MODULE_NAME/build/libs.
You can copy this jar into libs directory of all your android projects that need to interact with your back-end.
This approach makes it really easy to get out of sync though. After every change to back-end you would need to update the .jar in all dependent modules.
Are all of your Android applications in the same Android Studio project? If so I think you might be able to just add
compile project(path: ':{yourBackendModuleGoesHere}', configuration: 'android-endpoints')
to each of your Android apps build.gradle.
You could probably also make it work even if your backend is in a separate AndroidStudio project as long as they're part of the same gradle build.
I got an error in the build server when sending an Android build during the dex phase.
Googling a bit I learned that there is a hard limit of 64K functions (including all libs, the heaviest is google play services), or you can use the multiple dex mechanism.
How do I activate this for Codename One?
I understand Codename One uses Ant and as far as I understand this only works for gradle.
FYI this is the workaround, that splits google play services into sub libraries with native android:
http://android-developers.blogspot.com.es/2014/12/google-play-services-and-dex-method.html
I had a very similar issue and corresponded with Codename One's pro support on this. Gradle support was something they just recently announced so its not as documented but should be available in the next update.
You need to add the following build hints to your project:
android.gradle=true
android.multidex=true
I understand that gradle will be the default build once 3.3 rolls around so in the future only the multidex option will be needed.
You don't have to add Google Play Service Library in your codenameone app, just add android.includeGPlayServices=true to your build hint and it would be included in build server.
I have SDK (.jar file) written in Java. I created an Android Java Bindings Library following that description. I used the generated JNI files from the jar to write the API for my Xamarin plugin. I dont have experience with Xamarin, so I would like to ask you these questions:
My SDK.jar file depends on the Google Play Services.jar file. How and where I have to add it? I want to make the plugin to add the Google Play Services automatically to the project where it's installed my plugin. Like Google Play Services plugin adds Support library when it's added.
Could someone explain to me what's the difference between Components and Packages? I have these folders and I dont know in which one I have to add the Google Play Services Plugin and what's the difference.
How to get the current activity from my API files? I dont use Xamarin.Forms. Should I?
Thanks in advance
To clarify:
Answer for 2:
Components are Xamarin Components whereby packages are mostly nuget packages. User is not forced to publish component on Xamarin Component store, but many do. Some don't because Xamarin Component must have accompanying samples, documentation and screenshots, so for the large number of users effort to implement component is substantial. That is the reason a lot of authors just publish their SDKs on nuget.
Xamarin Components are tested before publishing by Xamarin Components Team and the reason is mainly correctness and quality (something like Apple's app submission process). This should help users to have minimal/starter samples that show how the SDK/component work and some documentation.
Some authors publish their components in steps: first nuget and when samples and docs are ready then Xamarin Component which references nuget dependencies mentioned in 1st step. This is called empty-shell (or just shell component). User can install it either as nuget or as component into some application or library.
Packages (nuget) are installed via Nuget Package Manager in Visual Studio or Xamarin studio. While components are added to you project. Samples and docs can be found in Components/ folder in solution root.
Plugins are special form of component used mostly for cross platform Xamarin.Forms (but not only) applications and they utilize special technique called bait-and-switch for loading platform specific dlls (from nugets).
Google Play Services (GPS) are not plugins, because they are Android only, so no need for plugin (ios and Windows parts). I think there is only Game Service on iOS, but not sure.
GPS come in 2 flavors as nuget packages and as components (empty shell).
Here are the answers of my 2 questions:
in component.yaml file before publishing the plugin: http://developer.xamarin.com/guides/cross-platform/advanced/submitting_components/components_and_nuget/
Don't have the answer yet...
Can't get it from API files if you dont send it as a parameter, but then your API is not compatible with the iOS API. Because of this I separated the plugin: one for Android and another for iOS.
Right now I've finished an application that I want to distribute on Android Market.
It will have a payed version and a free version with some limited features.
While developing it, I was doing obviously just the main project of fully featured release. And now after finished I've included a "boolean" DEMO_VERSION=true that restrict those features.
My question is if it's possible to generate both apk from the same project? Or should I create new project with the same source but changing the java package to tell android market that they're two different applications.
Thank you very much
Here's a good article on exactly that question: http://ulrichscheller.blogspot.com/2009/10/android-deploying-multiple-targets-from.html