I recently found the MaterialViewPager library on Github where the author also included a sample app. The sample app on Github is dependent to two other moduels :
materialviewpager
materialviewpagercontroller
I tried to convert the sample app provided into an standalone app by creating a blank project in Android Studio and including :
compile ('com.github.florent37:materialviewpager:1.2.0#aar'){
transitive = true
}
in the build file. Then I copied all the files in the sample folder to the app but I got so many errors in every file, after removing a lot of files and getting the app to compile I got this:
Since I am new to Android Studio and I spent two hours trying this without any success, can someone please let me know how I can convert the sample app the author provided to a standalone sample app?
Related
Hello I am new to flutter and i want to do native function calls using flutter, i wrote an sample native code app and it is working as expected. Now i want to use some packages on my android code, which is platform specific.
I have added my dependcies in my build.gradle file and it the gradle build is success,
But i cannot use the package there,
say for example: i have added the dependency for the com.squareup.okhttp3:okhttp:3.4.2 and gradle build is success and now icannot access their methods and other stuffs. Please let me know to what to do with it. Thanks in advance.enter image description here
Finally it worked, i opened the android project as an new android project in android studio which resolved the issue.
I've been trying to attach the Google Licensing Validation Check (https://developer.android.com/google/play/licensing/setting-up.html) to my application made with Appcelerator. I found a GIT repository (https://github.com/eric-sofisoftwarellc/TiLicensing) that was supposed to contain a module that would do the job, but there is no .ZIP file in there, so the instructions are either incomplete or unclear.
I have tried to add the source files into the "modules" folder of my application, but it displays this error:
ti:/module.js:280: Uncaught Error: Requested module not found: com.sofisoftwarellc.licensechecker.
I also found this question (How to add Google Play license into an android application created with Appcelerator?), that redirected me to the same repository in the end.
Does someone have the .zip file that is specified in the instructions of the GIT repository or has someone ever made it work? I've tried building the module with Appcelerator Studio, but it did not work.
Could someone please help me? Thanks in advance.
If you want to use it in a Titanum SDK 6+ project you have to recompile the module because it was created 2 years ago. But that won't work that easily because it is using some legacy classes (org.apache.http) so you have to change the module in order to get it to work, sorry.
I'm trying to add Google FCM push notification function to Unity project. I'm surprised that there are no resources about Google FCM for Unity. There are only old Google GCM resources. This is my step-by-step progress below.
Make Android Studio project and register it to a FCM console project
Add google-service.json to '/app' and configure build.gradle (project and module)
Add MyFirebaseInstanceIDService, MyFirebaseMessagingService java classes and onTokenRefresh, sendRegistrationToServer, onMessageReceived, sendNotification methods according to sample example in FCM document
Add services for the classes to AndroidManifest.xml
After that, I tested the Android Studio project on mobile, and FCM console push notification works well. Then, I started to configure the Android Studio project for Unity.
Change 'application' to 'library' in build.gradle (module) and add deleteOldJar, exportJar for AndroidPlugin.jar
Add classes.jar of Unity to Android Studio library and module setting
Remove 'android:icon ...', 'android:theme ...' in AndroidManifest.xml
Export jar and add AndroidPlugin.jar, AndroidManifest.xml to 'Plugins/Android' in Unity
Then, I tested the Unity project on mobile. It is built without exception, but FCM console push notification didn't work. (I made test log for confirming that the Android Studio libray is well plugined for Unity, the log worked well)
Maybe, there are somethings to add to 'Plugins/Android' except AndroidManifest.xml and AndroidPlugin.jar like references below.
Google firebase analytics plugin for unity - StackOverflow
http://joxi.ru/Q2KeQD7C3zdYrj
But, I couldn't find my answer. Please let me know what I have to do or add.
Sorry for bad english and long explanation. Many thanks :)
I used Unity SDK in OneSignal.
It is very simple, easy, and cool SDK for push notification.
Reference link below.
https://onesignal.com/
This approach will not be feasible.
Jar files do not contain resources, and as such, the json file will be missing from the jar build. Alternatively, aar files, which would in theory contain the resources, are interpreted by Unity3D as pure plugin and ignores the resources or at least some, specially when using gradle. But Unity is getting better at it.
Try https://firebase.google.com/docs/unity/setup. It's new and I got the sample project to work already.
Just to add: the new Plugin of Firebase for Unity3D worked liked a charm. Use cases like pure system try notification don't need a single line of additional programming on the client side. Data Messages are very easily implemented as well.
In an android project, when you install library with gradle
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
Is there a way to look at the source of the library?
edit
https://developers.facebook.com/docs/android/getting-started
Talks about the sample code is included in the sdk. How do I view this sample source?
You can see the source code and the samples of Facebook Android SDK on GitHub:
https://github.com/facebook/facebook-android-sdk/
https://github.com/facebook/facebook-android-sdk/tree/master/samples
you can to initialize FB sdk 4.0 in sattings.gradle file
include ':app', 'FacebookSdk'
it will load whole SDK.
but still it gives you just iml file. it just pulls everything dynamically when called.
----------- Edit ----
I just tried rightnow,
If you are using android studio,
Just select your project explorer, as Project. generally its Android.
it that you will see whole list.
I can see facebook folder with all of its classes.
Let me know if it works for you.
Here in my project i have initialized FB SDK 4.0.
i'm try to upload video from youtube without using intent
in my previous Q
using youtube data in android project
Ibrahim Ulukaya Proposed to use in his example https://code.google.com/p/ytd-android/
at the time i add the project i receive message " built path contains duplicate entry 'src' for project "Youtube Direct ..."
this after i Include Google Play Services library to the project (this fix the all compile error exapt this "Error generating final archive: Found duplicate file for APK: resources.arsc")
in some form i saw that problem cause from marven plug in
so i add m2eclipse plugin maven-android-plugin
but i dont understand after i red marvel introdution what marvel do and for what the project need this plug in ???
Currently I am in state that I can not even start the project because of compilation problem.
Someone was in this situation and know what I need to do for resolve this and start working with the project???
Ibrahim Ulukaya told me that i don't need the whole project, i can just use UploadService.java and ResumableUpload.java.
so I deleted the other files but did not help
I think Maven is a really good tool, but if you want you can create an Eclipse Android project without Maven, that is simpler. Then copy the code from the src folder and resources from the res folder.
You must include Google Play Services and the latest YouTube client library for Android with its dependencies:
https://code.google.com/p/google-api-java-client/wiki/APIs#YouTube_Data_API