Import admob ads to android project only with notepad++ - Android Q&A, Help & Troubleshooting

i want to import admob ads to my project files, i downloadet an open source sample and i want to test ads there, i cant open my files in android studio, how can i edit files and import admob,so i want to import google play services library or redirect them to my project, please help. Thanks

Related

start edit rom

Hi i have received from China sources code Rom.
I 'd like edit Bluetooth app.
I create project in Eclipse, import project app but there are Class and Method HIDE.
Sources bluetooth app request a com.android.bluetooth.Utils and I download but this class com.android.bluetooth.Utils invoke hide method.
are there some guide to create rom starting sources?

Proper way to use and dig into the android library code in eclipse

1- Why I can't open xml files from android library in eclipse? When I double click on it, I got this error:
Android XML Editor cannot process this input.("i.stack.imgur.com/aiaa9.png")
2- How can I search in android library codes?
3- Where is setting activity in this library? To be more specific I want Date & Time activity ("i.stack.imgur.com/lY7SJ.png")

Error while importing project in android studio please help

i am a newbie, i am getting the following error while trying to import an app in android studio:
* Project Ringster:F:\App\2\project.properties:
Library reference ..\TestLinSDK could not be found
Path is F:\App\2\..\TestLinSDK which resolves to F:\App\TestLinSDK
i need to present the apk in few hours if somebody could help me i'll be grateful, even i can give a free rooted server

Google Maps ASK or MapNox sdk in AIDE

All I have is my phone. And AIDE to code in. Following tutorials for both Google's api and mapbox api just gives me tons of errors. Can I use these apis without android studio?
I notice file names are a bit different like I have main.xml and not activity_main.xml
Can anyone help me get set up?

How to use any Kit in your Xamarin project

More information like this, you can visit HUAWEI Developer Forum
Original article link: https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201326096858500005&fid=0101187876626530001
Xamarin with HMS
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Xamarin : Cross-platform. Open source. An app platform for building Android and iOS apps with .NET and C#.
For now we don't have an official nuget plugin for Xamarin so you need to use the native Android sdk so you need to know about :
Binding a Java Library
Overview
The third-party library ecosystem for Android is massive. Because of this, it frequently makes sense to use an existing Android library than to create a new one. Xamarin.Android offers two ways to use these libraries:
Create a Bindings Library that automatically wraps the library with C# wrappers so you can invoke Java code via C# calls.
Use the Java Native Interface (JNI) to invoke calls in Java library code directly. JNI is a programming framework that enables Java code to call and be called by native applications or libraries.
so in briefwe can say if we used the Binding Native library we will convert the sdk from the java code to c# code to being used in your xamarin project , the binding project will contains a wrapper that will convert the jave code to the C# code .
The question now as we know there is a lot of different between C# and Java so should i have any issue after the wrapper job ??
the answer for this yes because you will find some language rules will not be included in C# or maybe you will find something can be implement in Java but in C# have different way to be implement and in some case multiple way ,so the wrapper will make a lot of hard work to you but in some times you need to modify the wrapper result to make the code build-able and compiled with no issues ,
When binding an existing Android library, it is necessary to keep the following points in mind:
Are there any external dependencies for the library? – Any Java dependencies required by the Android library must be included in the Xamarin.Android project as a ReferenceJar or as an EmbeddedReferenceJar. Any native assemblies must be added to the binding project as an EmbeddedNativeLibrary.
What version of the Android API does the Android library target? – It is not possible to "downgrade" the Android API level; ensure that the Xamarin.Android binding project is targeting the same API level (or higher) as the Android library.
What version of the JDK was used to compile the library? – Binding errors may occur if the Android library was built with a different version of JDK than in use by Xamarin.Android. If possible, recompile the Android library using the same version of the JDK that is used by your installation of Xamarin.Android.
Now from where can i got the SDK
You will find a direct link for some SDKs at our website with (.arr) or (jar) extensions some times you need multiple jars and arr for one SDK for example if you want to use the Ads Kit you will find the following files to get the full SDK:
Ads Banner (.arr) or (jar) extensions
Ads Base (.arr) or (jar) extensions
Ads Consent (.arr) or (jar) extensions
Ads Interstitial (.arr) or (jar) extensions
Ads Lan (.arr) or (jar) extensions
Ads Lite (.arr) or (jar) extensions
Ads Native (.arr) or (jar) extensions
Ads Reward (.arr) or (jar) extensions
Ads Splash (.arr) or (jar) extensions
Ads Template (.arr) or (jar) extensions
after you get these files you need to create Bindings Native Library for each project and then add the file (.arr) or (jar) inside the project and   then compile it to get the SDK as DLL as following :
1.Create new project   
2.Select android bindings library project
3.Configure your new project
4.Finally you will have the following project structures
You can add all the projects in one solution like below
by right click on the soultion => add new project and re-follow all the steps before
After doing this you need to take the (.arr) or (jar) and adding it to the Jars folder and change the Build Actions as following :
EmbeddedJar – Embeds the .jar into the resulting Bindings Library DLL as an embedded resource. This is the simplest and most commonly-used build action. Use this option when you want the .jar automatically compiled into byte code and packaged into the Bindings Library.
InputJar – Does not embed the .jar into the resulting Bindings Library .DLL. Your Bindings Library .DLL will have a dependency on this .jar at runtime. Use this option when you do not want to include the .jar in your Bindings Library (for example, for licensing reasons). If you use this option, you must ensure that the input .jar is available on the device that runs your app.
LibraryProjectZip – Embeds an .AAR file into the resulting Bindings Library .DLL. This is similar to EmbeddedJar, except that you can access resources (as well as code) in the bound .AAR file. Use this option when you want to embed an .AAR into your Bindings Library.
ReferenceJar – Specifies a reference .jar: a reference .jar is a .jar that one of your bound .jar or .AAR files depends on. This reference .jar is used only to satisfy compile-time dependencies. When you use this build action, C# bindings are not created for the reference .jar and it is not embedded in the resulting Bindings Library .DLL. Use this option when you will make a Bindings Library for the reference .jar but have not done so yet. This build action is useful for packaging multiple .jars (and/or .AARs) into multiple interdependent Bindings Libraries.
EmbeddedReferenceJar – Embeds a reference .jar into the resulting Bindings Library .DLL. Use this build action when you want to create C# bindings for both the input .jar (or .AAR) and all of its reference .jar(s) in your Bindings Library.
EmbeddedNativeLibrary – Embeds a native .so into the binding. This build action is used for .so files that are required by the .jar file being bound. It may be necessary to manually load the .so library before executing code from the Java library. This is described below.
but usually we will use EmbeddedJar and LibraryProjectZip .
you can change build action like this
right click at the file it self like this and click on properties
2.then you will note the properties tab like this
And then you should choose from the build action a LibraryProjectZip for aar files and EmbeddedJar for jar files.
After this you need to build the project by right click on the project and build as below.
After the build completed without errors you should go to the obj folder it will be hiden from the solution so maybe you need to open the folder from by the path and you will find the obj folder like this
and you will find the DLL file inside your debug folder with the same name of your project that contains the SDK in C# code and then you can go to you main project and add this Dll as a reference and if you want to know if it compiled fine you can go to objDebuggeneratedsrc and this folder shouldn't be empty like the below
In case you have a build errors and you follow these steps in correct way it could be for tow reason
you have error related to the Java rules can't be done from the wrapper it self like name of object or return type ..ect then you need to fix these error using the metadata.xml file
to know more about these error and how to fix them you need to the following link its a line of code to manage how the wrapper handle this code https://docs.microsoft.com/en-us/xamarin/android/platform/binding-java-library/customizing-bindings/java-bindings-metadata
the second one your project depends on another dll to be complete for example when you use the ADs kit the Ads Banner need a refrance from Ads Base if not you will see error display can't find class with name so you need to know how to refernace your projects together
Conclusion
you need to setup your SDK on C# to enable you access the functions and method by using Binding a Java Library
Reference
https://docs.microsoft.com/en-us/xamarin/android/platform/binding-java-library/customizing-bindings/java-bindings-metadata
https://docs.microsoft.com/en-us/xamarin/android/platform/binding-java-library/
https://developer.huawei.com/consumer/en/doc/HMS-Plugin-Library-V1/xamarin-sdk-download-0000001050175494-V1
https://developer.huawei.com/consumer/en/doc/HMS-Plugin-Guides-V1/creating-xamarin-android-binding-libraries-0000001050267972-V1

Categories

Resources