How can I use whole android project inside a new android project - android

I have source code of indic-keyboard, and I want to use functionality of this project in my app, I have tried converting indic-project into a library, but that seems tough, so I am looking for some other workaround for this thing.
What can/have I try/tried-
I try to change "apply plugin: 'com.android.application'' to "apply plugin: 'com.android.library", then synced the gradle and got this some errors(check this issue), there I got confirmation developer of indic-keyboard that it will be tough to convert it into a library as this project is an input-method which relies on system settings.
So now I am thinking to use whole the project within my app, such that it will compile just after the installation of my app, but I am not sure where to start, I mean what things should I remove from build.gradle of indic-keyboard so that it stop generating apk, if somehow I am able to do that then it may not be that tough,I need just the idea how should I proceed, so if you have worked on these type of things then please provide your valuable suggestions.
*edit - I have also tried importing as module(suggested by zgc7009) but that produces error as shown in following images

The Indic Keyboard is already available on the play store, I would suggest to check at runtime if the user has that package (details here) and act accordingly: if the user has the package then fine, otherwise you can open the play store (details here)

Related

Can an application module also be used as a library module?

I have a simple calculator app. It's a complete application all by itself.
I also have a more advanced calculator app that's based on the first app, but has more features. Its main Activity extends the first app's main Activity. The advanced app references quite a lot of resources and methods from the simpler app.
Getting the advanced app to build under Android Studio has been a nightmare. I've been googling and trying things blindly in the build.gradle files, but not making much progress. At first, the problem was dependent features configured but no package id was set (whatever that means, Google turned up no documentation.)
I got past that by tweaking the build.gradle files, and now I'm getting Manifest merger failed with multiple errors, see logs, but I can't find the relevant logs. It looks like the build failed because Android Studio tried to merge the AndroidManifest.xml files from the simple app and the advanced app, but I just wanted to use the manifest from the advanced app.
This is all very frustrating because I made it all work under Eclipse but now I have to move to Android Studio.
I guess my first question is: How can I tell Android Studio to just use the Android Manifest from the current project and not try to merge from the other project.
In general: can an application project serve as a library for another project, and if so how? Are there any examples?
Third question: where can I find good documentation on build.gradle?
I could attach my current build.gradle files and AndroidManifest.xml files if people need to see them, but I'm really hoping to learn enough that I can help myself.
Confirm the problem first:
Switch the same model in Library / application
Application ID androidmanifest conflict problem
if this is the problem, the official documents can see the channel packaging
https://developer.android.google.cn/studio/build
And I wrote you a little demo
https://github.com/yuanweiwork/lytools
I hope it can help you

How to remove all traces of Crashlytics in Android app?

I am trying to move app to another agency. Ideally, it would be as simple as changing Organization API key and adding its secret into fabric.properties file. But this is not happening.
I have tried to remove all traces of Crashlytics so I can install it like the first time and pick the desired organisation. So I removed all Gradle entries, an entry from the Manifest and deleted fabric.properties file. I also logged out of Fabric plugin and restarted Android Studio, just in case. However this does not work. When I compile the app, it fills the old Organization data.
So how can I completely remove ALL traces of Crashlytics so the project looks just like before I installed it?
PS. also if someone knows how to move app to another organization (the method that does work), please share it with me.
I am looking to do the same and would try doing the reverse from what is advised in the installation instructions here.
Meaning:
removing the repository, plugin, and the dependencies from build.gradle;
removing the keys (fabric.properties or app manifest xml);
removing the initialization code;
I may add more details once actually trying to do this myself.

"Package file is invalid", solution from the developer side (Android)

I'm tired to see a lot of Stackoverflow questions about this, even in Google forums or Google official support site, publishing "solutions" that lead to uninstall package through ADB, to do something with the phone rooted, to delete cache of Google Play Services, etc ...
https://code.google.com/p/android/issues/detail?id=64514
https://support.google.com/googleplay/answer/3300875?hl=en
http://gizmostorm.com/how-to-fix-package-file-is-invalid-error-on-google-play-store/
https://www.google.com/search?sourceid=chrome-psyapi2&ion=1&espv=2&ie=UTF-8&q=android%20upgrade%20download%20invalid%20package ...
etc ...
Is there any solution from the package side ?
I mean, I have an app with hundreds of thousands of installs, and unfortunately many users are complaining about this error when upgrading from store my new version.
Obviously, I can not go one by one telling they have to do this or that, because they are not developers, they just want to upgrade and run an app !
Some users are telling me (complaining) this happened since the last "upgrade attempt" of my app, and they are not experiencing this "package file is invalid" with any other app in their phones.
So, I guess it's something I can fix with another upgrade.
Is there ANY SOLUTION that I can do in the next APK compilation, uploading to Google Play Store and fix this without "bothering" my users ?
Thank you in advance
I have also faced same issue in my project as well. I was adding many more features with new jar, git open source library code for Nice UI.
For searching for solution I found play store has issue in one of its updates
http://www.androidcentral.com/google-investigating-package-file-invalid-errors-google-play
But this is totally not relevant to my problem
Again searching I found this
http://birbit.com/how-to-solve-linearalloc-problem/
So the solution looks to be loading a few jar files dynamically using DexClassLoader.
http://android-developers.blogspot.in/2011/07/custom-class-loading-in-dalvik.html
Prepare Interface of the jar file (list of all classes and methods) and have the interface in the app - Need to see how to do this. - We can just have those classes which we need in our app and ignore the rest of the classes. This way we can implement for few existing jars and any new jars that we have to add to make sure we don’t run into this issue again.
Keep the jar in assets folder
Load every class from the jar (based on the list of jars we have in the interface). (The classes will be loaded just once on first launch)
But Based on this, this looks to be involving lot of coding changes and a time consuming things.
Moreover I found that facebook also faced same issue in their initial android app
https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920
Final Approach I took was removing additional code from jar/git library project which is not require for my application. after that my app got install on 2.3.X with no error.

Bug in Inkfilepicker Android library

I'm using your Android library for an implementation of InkFilePicker in an Android app, but I'm having some issues: trying to upload a file, I get an "org.json.JSONException", since there's no value for "key" in the JSON I obtain as a response. I can handle the exception, but this would mean touching the library's files: is it ok? It shouldn't, I think. Library is outdated, or bugged: is there someone who already encountered this problem?
Another little problem: how can I change the default name "testfile.file" to the original one (e.g. "foo.jpeg")?
I had the same problem. I configured my S3 settings and everything went ok after that.

Android ActionBarCompat Not working from the start

OK, I have been wanting to try the new ActionBarCompat, however, I am not able to run my programs in the emulator.
I have been trying to implement the following: http://antonioleiva.com/actionbarcompat-how-to-use.
and have been stuck on basically the first part. However, working with the author of that content, I was able to get further as I was not adding the project under sdk\extras\android\support\v7\appcompat folder like stated. However, I still think that might be the reason I cannot do this...
More detail can be found here: http://antonioleiva.com/actionbarcompat-how-to-use/#comment-43
Basically, on my first attempt, I just created an Android project, and changed the source code as indicated. Code would not run on the emulator. So I went back to the original code, and that ran on the emulator.
Checked online, found out I might need to add the \extras\android\support\v7\appcompat folder as a library to the project I am building. So I added that and a new android project was created. There were build errors from the start, but I failed at trying to add it as a library to my project, and deleted it....thinking this was way overboard.
After back and forth chats with author of linked website, I found out I had to do that overboard thing.
So I tried the following link to the T: (I cannot post more than 2 links due to low repuation...I will add this link as a comment below)
However, Eclipse would not allow me to add the appcompat Existing Android Project...but it did allow me to add the appcompat Existing (General) Project. I think this may be some of the problems??
Right now, I cannot run the project at all. Eclipse is showing a red exclamation mark on the project folder, but all the code seems to be fine. So I don't know what to do now...I recreated this project several times over, and this one was the one where I knew what to do...and I am still getting problems
So...
I decided to move to Android Studio...updated the IDE, updated the SDK manager to include the new support library, and other things. Created a new project, added to the build.gradle file as shown in the link provided below in the comment. I ran the ant build, and then built the project...tried to import the right things to allow ActionBarActivity, but I could not get that far.
I can import
"android.support.v7.*"
"android.support.vy.R" // and all folders within
but nothing allows me to add ActionBarActivity, and I don't know why.
FYI, I guess I would prefer a solution to Ecplise, as it seems like I actually got somewhere with it.
The best example to use is from here, and I would follow it closely. I had similiar issues when I first came across this. Problem was I misunderstood what I needed to do
http://developer.android.com/tools/support-library/setup.html#libs-with-res

Categories

Resources