How android apps use library made by user? - android

I was reading one of the articles on internet and he was saying that he'll make library so that all the apps can use it. How is this possible? Any ideas?

To add libraries to your project, in eclipse package manager right click on your project select 'Properties' on the left select 'Java Build Path' then click on the libraries tab toward the top. Click the 'Add External Jars' button navigate to the jarfile and select it. Then you are ready to import and use whatever was inside of it in your project. I recommend you add a libs folder to your project and keep all of the jar files used in that project inside there so that if you distribute your project source to someone else they will have all of the needed libraries to compile it.

Related

MoPub Integration problems with Eclipse - Build Path / Jars

On the MoPub Integration Instructions it says to go to Properties, Build Path and click on 'add jar' and then to Click Add Jars and add the mopub-volley-1.1.0.jar from your download location.
I may be misunderstanding this, but when I click on Add Jars, I can only select locations within projects that are situation within my Eclipse workspace. Is it supposed to say 'Add External Jars'?........ It doesn't show this, it specifically shows the 'Add Jars' button highlighted, as you can see:
Or am I supposed to create a libs folder in my mopub-sdk project that I've imported and manually copy them in, then do 'Add Jars' and select them from there......
The docs say to 'Right click on your project' when adding these, however, the mopub-sdk that I've imported needs this Jar, so why do I have to add it to my project's build path when the MoPub-SDK is a dependency of my project - shouldn't I add it to the MoPub-sdk build path?!!
It's really confusing. Anyone who's integrated MoPub using Eclipse? This is now my 4th straight day attempting to integrate this, so any help would be much appreciated.

How does one add an external library jar to 'External Libraries' section of an Android Studio 1.3 project?

Trying to migrate to Android Studio 1.3 from good ol' Eclipse but it's frustrating.
How does one add an external library jar to 'External Libraries' section of the project?
Reading SO posts including here, I went to File|Project Structure|Modules
selected app and Dependencies tab.
Clicked '+'
It brings up the Select Path below
How do I add a jar file from D:\mylibs when the Home icon is disabled in the screenshot below?
I tried to copy the jars, and then right-click 'External Libraries'
and Paste but it did not work.
There is something wrong with the AS 1.3 dialogue where you add the .jar file. There are no buttons to navigate up the directory tree or change drives. Instead, to add the library, select the .jar file in Explorer (Windows), right click on it, select Copy, go to Android Studio, select Project->[NameOfYourApp]->app->libs and right click on libs and Paste file into it, click Ok on the confirmation box. Then, right click on the .jar file, go toward the bottom of the menu and select Add As Library. Then in the Create Library box confirm that it is adding to app and click Ok. Gradle will then automatically add it to the build dependencies. You can then check the build.gradle file to make sure you see this line: compile files('libs/[filename].jar') under the dependencies section.
Click on your project name on the project explorer, press "F4" or right-click on the name and select "Open Module Settings". Then click on "Dependencies" tab, and click the green "+" button on the right side, then select "File Dependency", this will bring up a Browse Window, use it to open the ".jar" or the ".aar" file.
Follow the next process and you should get it:

Issue with support library setup as per android developer guide using Eclipse

I've been through all of the subjects and all over Internet to try solving this problem, but can't seem to find any solution.
Basically I've followed every step here Support Library Setup - Adding libraries with resources, but can't figure out the last one.
Add the library to your application project:
In the Project Explorer, right-click your project and select Properties.
In the Library pane, click Add.
Select the library project and click OK. For example, the appcompat project should be listed as android-support-v7-appcompat.
In the properties window, click OK.
Now the problem is in library pane I see multiple add options (Add JARs, Add External JARs, Add Variable, Add Library Add Class Folder and Add External Class Folder)
Can anyone give me a bit more detailed explanation what I actually need to add?
The only place I see only Add option is "Projects" pane.
Cheers,
DP
This is to add a library that u got to your android application. So you can publish your app with the library to use it.
Like Actionbar sherlock, angEngine, admob or any other library.
To let your application support it, you should add it to it's project first.
And best way is to choose Add External JARS, or anything you would like.
First import the library into your workspace (where your androi project is). Import the library to eclipse. It is found under /sdk/extras/android/support/v7/appcompact.
Right click on your android project. Goto properties. Choose android. Click Add browse and add reference the same in your android project
Click add browse and add the library project
When you add it looks like below
Do it the easy way : right click your project folder in the Package Explorer or Navigator, then look for Android Tools > Add Support Library. A dialog with open to ask you to accept the license. Accept, click Install, and you're good to go ;-)

how to deploy Pull-To-Refresh ListView by johannilsson

I have checked out johannilsson/android-pulltorefresh on github https://github.com/johannilsson/android-pulltorefresh .
There are 2 projects in it, pulltorefresh and pulltorefreshexample.
The example references com.markupartist.android.widget.PullToRefreshListView which is in the pulltorefresh, I do not know how to link the pulltorefresh for use.
Now I have problem making use of the library.
Copying file by file sure works, but it is far from convenient.
I have also checked the README.md, but it does not cover this.
There are similar library projects on github and they have the same
structure, but help files in them do not cover deploying, either.
I am using eclipse.
In eclipse do File->New->other (don't use File->new->Android application project) and select "Android Project from existing code".
Click next, then browse to the directory with the pulltorefresh library - if you want the files copied to your workspace then select the checkbox under the Projects list box. then click the Finish button.
Repeat what you just did, but this time select the pulltorefreshexample directory.
Make sure both these projects are open and then select pulltorefreshexample in the package explorer, right click it and select properties. In the window that appears select Android on the left, then at the very bottom there's a 'Library' section. Click Add and you should see a list with all open library projects. Select the pulltorefresh one.
Clean and build the library then clean and build the example.
That should do the trick for you.

how to include jar files in my eclipse project

I'm new to android and java. I downloaded the GSON library for use in my android project which exists in Eclipse. I lookup instructions on how to use the jar file in my project and it says...
Quote...
You can use a third party JAR in your application by adding it to your Eclipse project as follows:
In the Package Explorer panel, right-click on your project and select Properties.
Select Java Build Path, then the tab Libraries.
Press the Add External JARs... button and select the JAR file.
Alternatively, if you want to include third party JARs with your package, create a new directory for them within your project and select Add Library... instead.
It is not necessary to put external JARs in the assets folder
...UnQuote
I'm afraid that I don't know the difference between "using a 3rd party jar in my project" and "include third party jars with my package." I want to be able to use the GSON methods in my Android phone application and, of course, have the capability deployed in my .apk.
So, Which do I want to do?
Thanks, Gary
add the jar to your libs folder in your project.
open eclipse go to package explorer
right click on your project and select project properties
click on java Build path in the bar on the left hand side of the popup
select the libraries tab
select the "Add External Jar File" and navigate to your JAR file
best of luck =)
click Properties
left select Build path
Than add jar, and do not use the external libs, unless it is really required.
You have to copy the jar to your project to find it with "Add jars"
Right click onto your main project in the Project Explorer
Open properties option, found at the bottom of the context menu
A dialog box opens from which you select the Android option
Remove the old .jar file, click on ADD to add a new .jar file and select your the file you want to add
You're done!

Categories

Resources