Pre loader

have not set a license key problem

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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

Version
4.2.0.4557
  • Yura Khariton
    Can you provide a project which reproduces this issue? Where did you put a code which applies license key? Is it possible that it isn’t called when this message occurs or maybe you see some exceptions in logcat?
  • Gang Xu
    Thanks for the reply. I had this issue occasionally and didn’t find a pattern to reproduce it. The license key is in the main activity, and the charts are in different activities, just like the sample code did. Is it possible the app was in the memory for a while and the license key expired? Do I have to put the license key in the activities with charts? I’ll try to find out in what scenario the license key invalid and see if there’s anything helpful in the exceptions. Just wondering is it only me or someone else also has this issue? Thanks.
  • You must to post comments
0
0

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

  • Gang Xu
    thanks for the explanation. I’ll check my code.
  • You must to post comments
0
0

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.

  • Yura Khariton
    It’s possible that Android OS disposes application that currently run in background if there are no available resources for other apps. Is it possible to move code with setting license into Activity that uses SciChart and try again? Ideally I would ask you to provide a project which reproduces this issue so I can debug this issue on my PC.
  • Gang Xu
    That makes sense. I’ve moved the license to the activities that using charts and it seems like the problem didn’t occur. Thanks for your advice.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies