How to change TChart source code

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
MSBT
Newbie
Newbie
Posts: 3
Joined: Thu Jul 23, 2015 12:00 am

How to change TChart source code

Post by MSBT » Sun Mar 13, 2016 1:03 pm

Hi,

I'm using TeeChart for my Android App. I would like to change the provided source code such that the behavior fits my needs a bit better.
I tried to add some methods in the provided java classes (files in "src" folder) and then to create a .jar (containing the modified src folder) of it and added this new jar file as library. (I created the jar file by using command "jar cvf new.jar META-INF com" in command promt)
This leads to errors regarding the compiler. TeeChart classes cannot be resolved anymore.
Then I copied the whole "com" folder of the "src" folder to my project in "app>src>main>java", which compiles fine.
But the app crashes as soon as the layout in which the TChart is placed is inflated .

Can you please give me a instruction how to import my modified source files to Android Studio properly?

Thank you in advance!
Best regards
msbt

Yeray
Site Admin
Site Admin
Posts: 8704
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to change TChart source code

Post by Yeray » Mon Mar 14, 2016 3:56 pm

Hello,

Check out this article.
Don't hesitate to let us know if you still find problems with it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

MSBT
Newbie
Newbie
Posts: 3
Joined: Thu Jul 23, 2015 12:00 am

Re: How to change TChart source code

Post by MSBT » Mon Mar 14, 2016 4:40 pm

Hello Yeray,


thank you for your quick answer, but i'm afraid this didn't solve my problem. As far as I can see this more a instruction how to add the teechart library in general.
What I want is to change some methods in the provided library. So I thought best way would be unzip the "src" zip folder (which I could find after installation in the downloaded "TeeChartJavaAndroidSrc_3.2015.0108" folder and then to make changes in the therein contained java classes. The next step is where I get stuck. How do I import my modified classes to Android Studio?

Thank you in advance!
Kind regards
msbt

Yeray
Site Admin
Site Admin
Posts: 8704
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to change TChart source code

Post by Yeray » Tue Mar 15, 2016 9:19 am

Hello,

I'll try to explain the steps to add the TeeChart sources to an Android Studio project.

1. Create a new project in Android Studio. I've created a simple app targeting API 15+, with a blank activity leaving the default name "My Application".

2. Add a new library module to the Project Structure:
new_module.png
new_module.png (21.93 KiB) Viewed 2296 times
new_library.png
new_library.png (29.64 KiB) Viewed 2292 times
3. Give it a name and a target. I've named it as "TeeChart", "com.steema.teechart" and target API 7+:
new_module_name.png
new_module_name.png (16.87 KiB) Viewed 2290 times
This creates a folder tree under your app "teechart\src\main\java\com\steema\teechart"

4. After installing TeeChart for Android with sources or TeeChart Java Suite with sources, you should find a src.zip containing the sources. Extracting it you'll find the TeeChart Java for Android sources, with a structure similar than the created on the empty module above: "src\Android\com\steema\teechart".
Copy the contents of this path into the path above in your module to have something like this:
files.png
files.png (23.98 KiB) Viewed 2292 times
5. At "Project Structure", add the dependency:
module_dependendy.png
module_dependendy.png (18.46 KiB) Viewed 2296 times
teechart_dependency.png
teechart_dependency.png (5.05 KiB) Viewed 2292 times
Now you should be able to import TeeChart units, so you would be using TeeChart directly from the sources!
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply