SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Hi,
I have a valid license key for development. But occasionally the charts show the message below and I have to restart the app to avoid that. May I ask is there a reason for that and how to fix it?
"Sorry! You have not set a License Key. You can request a free trial key from www.scichart.com/licensing-scichart-android or purchase at store.scichart.com."
Thanks,
Gang
Hi Gang Xu,
As far as I know there were similar reports, but they were caused by applying license key after creating SciChartSurface. In this case license key isn’t applied to existing chart.
You have to ensure that license key is applied before you create any SciChart releated classes ( e.g. inflate SciChartSurface from xml or defining parts of charts in code ). If license key is valid, then after you apply in it in runtime, it should work for all created charts until you close your application and Android OS disposes its resources.
In our demo application we create custom Application class and apply license key in its onCreate() method, because it’s called once when application is started before creation of any activities. You can also apply license key in activity with chart if you want, but as I said before need to apply it before creation of SciChartSurface instances.
Best regards,
Yura
Hi Yura,
The license issue happened again yesterday when the app resuming from the background. I can see the data streaming is not interrupted but the charts were invalid. So the app was definitely not closed in this scenario. I tried to reproduce the license issue but couldn’t repeat it on purpose.
The license key was applied in MainActivity
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_main);
// sciChart license
sciChartLicense();
}
The charts were created in different Activities.
@Override
protected void onResume() {
super.onResume();
// if no changes made, resume ECG and ECM chart without interrupting
if (init_settings()) {
// initialize SciChart
createSciCharts();
// clear ECM content
initECMSciChartData();
}
}
Please advise if you see anything wrong in my code. Thanks.
Please login first to submit.