Hi,

Now I'm getting log like,

10-14 07:38:18.970    5362-5362/org.wso2.myapplication3 D/dalvikvm﹕
Late-enabling CheckJNI
10-14 07:38:19.074    5362-5362/org.wso2.myapplication3 D/dalvikvm﹕
GC_FOR_ALLOC freed 290K, 4% free 9019K/9336K, paused 3ms, total 7ms

My app is not working yet.If you have any suggestions please share with me.

Thank You.

On Wed, Oct 14, 2015 at 4:43 PM, Lasantha Fernando <lasan...@wso2.com>
wrote:

> Hi Lakini,
>
> Please include siddhi-query-compiler-3.0.2.jar to your dependencies as
> well.
>
> Thanks,
> Lasantha
>
> On 14 October 2015 at 15:07, Lakini Senanayaka <lak...@wso2.com> wrote:
>
>> Hi,
>>
>> I have created an sample application using Siddhi-3.0.2 in android Studio.
>>
>> This is my code.
>>
>> package org.wso2.myapplication3;
>>
>> import android.os.Bundle;
>> import android.support.v7.app.ActionBarActivity;
>> import android.util.Log;
>> import android.view.Menu;
>> import android.view.MenuItem;
>> import android.view.View;
>> import android.widget.EditText;
>> import org.wso2.siddhi.core.ExecutionPlanRuntime;
>> import org.wso2.siddhi.core.SiddhiManager;
>> import org.wso2.siddhi.core.event.Event;
>> import org.wso2.siddhi.core.query.output.callback.QueryCallback;
>> import org.wso2.siddhi.core.stream.input.InputHandler;
>> import org.wso2.siddhi.core.util.EventPrinter;
>>
>> public class MainActivity extends ActionBarActivity {
>>
>>     SiddhiManager siddhiManager=new SiddhiManager();
>>     ExecutionPlanRuntime executionPlanRuntime;
>>
>>     @Override
>>     protected void onCreate(Bundle savedInstanceState) {
>>         super.onCreate(savedInstanceState);
>>         setContentView(R.layout.activity_main);
>>
>>         //passing the rules to the siddhi
>>
>>         String cseEventStream = "@config(async = 'true') define stream 
>> StockQuoteStream (value double);";
>>         String query = "@info(name = 'query1') from 
>> StockQuoteStream[value>20] insert into HighValueQuotes;";
>>         executionPlanRuntime = 
>> siddhiManager.createExecutionPlanRuntime(cseEventStream + query);
>>         executionPlanRuntime.addCallback("query1", new QueryCallback() {
>>             @Override
>>             public void receive(long timeStamp, Event[] inEvents, Event[] 
>> removeEvents) {
>>                 EventPrinter.print(timeStamp, inEvents, removeEvents);
>>                 Log.d("app3", "Received event!!");
>>             }
>>         });
>>     }
>>
>>     @Override
>>     public boolean onCreateOptionsMenu(Menu menu) {
>>         // Inflate the menu; this adds items to the action bar if it is 
>> present.
>>         getMenuInflater().inflate(R.menu.menu_main, menu);
>>         return true;
>>     }
>>
>>     @Override
>>     public boolean onOptionsItemSelected(MenuItem item) {
>>         // Handle action bar item clicks here. The action bar will
>>         // automatically handle clicks on the Home/Up button, so long
>>         // as you specify a parent activity in AndroidManifest.xml.
>>         int id = item.getItemId();
>>
>>         //noinspection SimplifiableIfStatement
>>         if (id == R.id.action_settings) {
>>             return true;
>>         }
>>
>>         return super.onOptionsItemSelected(item);
>>     }
>>
>>     //passing data to the stream
>>     public void onClick_Button (View v) throws InterruptedException {
>>         EditText t = (EditText) findViewById(R.id.editText);
>>         double value = Double.parseDouble(t.getText().toString());
>>         Log.d("app3",String.valueOf(value));
>>
>>         //send events/data in to stream
>>         InputHandler inputHandler = 
>> executionPlanRuntime.getInputHandler("StockQuoteStream");
>>         executionPlanRuntime.start();
>>         inputHandler.send(new Object[]{value});
>>         executionPlanRuntime.shutdown();
>>     }
>> }
>>
>>
>> I have included the log file which I got when I run the app.
>>
>> 10-14 04:28:01.025  16126-16126/? D/dalvikvm﹕ Late-enabling CheckJNI
>> 10-14 04:28:01.073  16126-16126/? I/dalvikvm﹕ Could not find method
>> org.wso2.siddhi.query.compiler.SiddhiCompiler.parse, referenced from method
>> org.wso2.siddhi.core.SiddhiManager.createExecutionPlanRuntime
>> 10-14 04:28:01.073  16126-16126/? W/dalvikvm﹕ VFY: unable to resolve
>> static method 30602: Lorg/wso2/siddhi/query/compiler/SiddhiCompiler;.parse
>> (Ljava/lang/String;)Lorg/wso2/siddhi/query/api/ExecutionPlan;
>> 10-14 04:28:01.073  16126-16126/? D/dalvikvm﹕ VFY: replacing opcode 0x71
>> at 0x0000
>> 10-14 04:28:01.073  16126-16126/? I/dalvikvm﹕ Could not find method
>> org.wso2.siddhi.query.compiler.SiddhiCompiler.parse, referenced from method
>> org.wso2.siddhi.core.SiddhiManager.validateExecutionPlan
>> 10-14 04:28:01.073  16126-16126/? W/dalvikvm﹕ VFY: unable to resolve
>> static method 30602: Lorg/wso2/siddhi/query/compiler/SiddhiCompiler;.parse
>> (Ljava/lang/String;)Lorg/wso2/siddhi/query/api/ExecutionPlan;
>> 10-14 04:28:01.073  16126-16126/? D/dalvikvm﹕ VFY: replacing opcode 0x71
>> at 0x0000
>> 10-14 04:28:01.101  16126-16132/? D/dalvikvm﹕ Debugger has detached;
>> object registry had 1 entries
>> 10-14 04:28:01.145  16126-16129/? D/dalvikvm﹕ GC_CONCURRENT freed 221K,
>> 3% free 8960K/9212K, paused 1ms+0ms, total 10ms
>> 10-14 04:28:01.213  16126-16129/? D/dalvikvm﹕ GC_CONCURRENT freed 255K,
>> 4% free 9091K/9376K, paused 2ms+1ms, total 9ms
>> 10-14 04:28:01.297  16126-16129/? D/dalvikvm﹕ GC_CONCURRENT freed 378K,
>> 5% free 9100K/9508K, paused 3ms+1ms, total 10ms
>> 10-14 04:28:01.381  16126-16129/? D/dalvikvm﹕ GC_CONCURRENT freed 390K,
>> 5% free 9096K/9516K, paused 2ms+1ms, total 6ms
>>
>> This is my dependencies in the gradle file.
>> dependencies {
>>
>>     compile fileTree(dir: 'libs', include: ['*.jar'])
>>     compile 'com.android.support:appcompat-v7:22.2.1'
>>     compile files('libs/antlr-runtime_3.2.0.wso2v1.jar')
>>     compile files('libs/antlr_3.2.0.wso2v1.jar')
>>     compile files('libs/stringtemplate-3.2.1.jar')
>>     compile files('libs/commons-pool_1.5.6.wso2v1.jar')
>>     compile files('libs/log4j-1.2.17.jar')
>>     compile files('libs/mvel2_2.1.0.wso2v1.jar')
>>     compile files('libs/siddhi-query-api-3.0.2.jar')
>>     compile files('libs/siddhi-core-3.0.2.jar')
>>     compile files('libs/json-20140107.jar')
>> }
>>
>> Could you please tell me the other files which I have to include in my 
>> app,if this happens because of a dependency issue(I have already used  
>> siddhi-query-api-3.0.2 and siddhi-core-3.0.2) and please guide me how to 
>> continue the task.
>>
>> Thank you.
>>
>>
>>
>>
>>
>> On Wed, Oct 14, 2015 at 12:06 PM, Lasantha Fernando <lasan...@wso2.com>
>> wrote:
>>
>>> Hi,
>>>
>>> You can read more about the syntax and annotations from the SiddhiQL
>>> guide. For stream syntax, please refer to [1]. You can drop the
>>> @config(async='true') annotation in Siddhi-3.0.0 since that is the default
>>> mode and the only mode of processing currently.
>>>
>>> [1]
>>> https://docs.wso2.com/display/CEP400/SiddhiQL+Guide+3.0#SiddhiQLGuide3.0-EventStreamDefinition
>>>
>>> Thanks,
>>>
>>> On 14 October 2015 at 12:00, Lakini Senanayaka <lak...@wso2.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have read the link Lasantha gave me.[1]
>>>>
>>>> Is there any format of writing EventStreams and queries as strings when
>>>> passing them to the createExecutionPlanRuntime method ?
>>>>
>>>> Example:-
>>>> String cseEventStream = "@config(async = 'true') define stream
>>>> cseEventStream (symbol string, price float, volume long);";
>>>>
>>>> I couldn't understand the annotations used to write them.Could you
>>>> please give me a reference to read about them.
>>>>
>>>> [1]
>>>> https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/test/java/org/wso2/siddhi/core/query/FilterTestCase.java
>>>>
>>>> Thank you.
>>>>
>>>> On Wed, Oct 14, 2015 at 11:17 AM, Lakini Senanayaka <lak...@wso2.com>
>>>> wrote:
>>>>
>>>>> Thank you Lasantha.
>>>>> I'll refer the link which you gave me.
>>>>>
>>>>> On Wed, Oct 14, 2015 at 11:07 AM, Lasantha Fernando <lasan...@wso2.com
>>>>> > wrote:
>>>>>
>>>>>> Hi Lakini,
>>>>>>
>>>>>> Better use a released version of Siddhi instead of the milestone
>>>>>> version. Siddhi-3.0.0-M1 would have very little of the actual features
>>>>>> implemented since this is the first milestone for the rewrite of Siddhi.
>>>>>> Siddhi-3.0.2 is already released and you can use that version instead.
>>>>>>
>>>>>> Also from Siddhi-3.0.0 onwards, separate methods like defineStream,
>>>>>> defineTable were removed from the API and there is a single API method
>>>>>> createExecutionPlanRuntime() to which you can pass in the complete query,
>>>>>> along with stream definitions, table definitions etc. This was done so 
>>>>>> that
>>>>>> the user can simply pass in the execution plan just as you would write 
>>>>>> the
>>>>>> query in CEP, without the API user having to know about different methods
>>>>>> to define different constructs of the language.
>>>>>>
>>>>>> You can refer to the test cases in [1] or any other test case to get
>>>>>> a better idea on how to use the Siddhi library API.
>>>>>>
>>>>>> [1]
>>>>>> https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/test/java/org/wso2/siddhi/core/query/FilterTestCase.java
>>>>>>
>>>>>> Thanks,
>>>>>> Lasantha
>>>>>>
>>>>>> On 14 October 2015 at 10:49, Lakini Senanayaka <lak...@wso2.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>  I have used SiddhiQueryapi  3.0.0M1 and SiddhiCore 3.0.0M1 in my
>>>>>>> android project.Now I can create siddhimanager instances.But I don't get
>>>>>>> defineStream,addQuery methods.Instead of that I get defineFunction.But 
>>>>>>> in
>>>>>>> the siddhi user guide there are examples with defineStream method.Could 
>>>>>>> you
>>>>>>> please explain me why is that and guide me how to continue the task.
>>>>>>> PS:I'm using siddhi queries in android.
>>>>>>>
>>>>>>> Thank you.
>>>>>>> --
>>>>>>> *Intern-Engineering*
>>>>>>> Lakini S.Senanayaka
>>>>>>> Mobile: +94 712295444
>>>>>>> Email: lak...@wso2.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> *Lasantha Fernando*
>>>>>> Senior Software Engineer - Data Technologies Team
>>>>>> WSO2 Inc. http://wso2.com
>>>>>>
>>>>>> email: lasan...@wso2.com
>>>>>> mobile: (+94) 71 5247551
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Intern-Engineering*
>>>>> Lakini S.Senanayaka
>>>>> Mobile: +94 712295444
>>>>> Email: lak...@wso2.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> *Intern-Engineering*
>>>> Lakini S.Senanayaka
>>>> Mobile: +94 712295444
>>>> Email: lak...@wso2.com
>>>>
>>>
>>>
>>>
>>> --
>>> *Lasantha Fernando*
>>> Senior Software Engineer - Data Technologies Team
>>> WSO2 Inc. http://wso2.com
>>>
>>> email: lasan...@wso2.com
>>> mobile: (+94) 71 5247551
>>>
>>
>>
>>
>> --
>> *Intern-Engineering*
>> Lakini S.Senanayaka
>> Mobile: +94 712295444
>> Email: lak...@wso2.com
>>
>
>
>
> --
> *Lasantha Fernando*
> Senior Software Engineer - Data Technologies Team
> WSO2 Inc. http://wso2.com
>
> email: lasan...@wso2.com
> mobile: (+94) 71 5247551
>



-- 
*Intern-Engineering*
Lakini S.Senanayaka
Mobile: +94 712295444
Email: lak...@wso2.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to