As I’m new to extension development. I was searching for how to add external library and I found this
https://docs.google.com/document/d/1xk9dMfczvjbbwD-wMsr-ffqkTlE3ga0ocCE1KOb2wvw/pub#h.3kn0fmfydnq1
But It is so confusing for me, please can anyone help with any other documentation.
Ken
(Ken)
April 4, 2019, 12:46pm
#2
The “build.xml” files and “lib” folder are in the Sources.
You can’t access them from Kodular IDE.
That being said there are a ton if Libraries already in the sources.
From the IDE click TOOLS>View Libraries:
If the one you are looking for isn’t listed you’d need to ask someone to add it.
1 Like
@Ken thanks for your reply,
I’m not using Kodular IDE, I’m making extension from the app inventor sources,as we can’t use our own library in it.
1 Like
Find Build.xml
Check how other .jar are arranged and copy and replace the path to new library
2 Likes
Ken
(Ken)
April 5, 2019, 1:41pm
#5
So 4 things need to happen:
Add .jar to lib folder.
Add reference to .jar in build.xml(appinventor/build.xml & appinventor/buildserver/build.xml).
Add @UsesLibraries (libraries = “simplifiedNameForJARFile.jar ”) to your .java file.
Add import simplifiedNameForJARFile.NameOfTheClassInJARFile; to your .java file.
Look at the instructions in the link you provided in the first post and look at the Twitter.java also:
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2012 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
package com.google.appinventor.components.runtime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.io.File;
import twitter4j.DirectMessage;
import twitter4j.IDs;
import twitter4j.Query;
import twitter4j.Status;
import twitter4j.StatusUpdate;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
This file has been truncated. show original
Note: I am not the foremost authority on this particular aspect of Extensions so, if anyone sees anything wrong with these steps please feel free to let me know
3 Likes
@Ken Thank you so much
Thats something I was searching for. You solved my problem. Thanks again.
3 Likes
David
( David Ningthoujam)
April 5, 2019, 2:14pm
#7
Marked as solution, don’t forget to do it
2 Likes
system
(system)
Closed
May 5, 2019, 2:14pm
#8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.