Messages by mobilist

15 topics, 24 messages
Kuix technical support » How To Set Image through J2ME on the screen apart from Setting it throgh XML

 

 Hi Tofu ! Thanks For Your reply..

I am able to download an immutable image from server and set it to data provider from where I have to render it to screen. Data Provider objects contains javax.microedition.lcdui.ImmutableImage@c5c7331 .

XML

<screen>
  <scrollPane usemarkers="false" style="align:fill-center ;layout:inlinelayout(false,fill);gap:0 5">

<container style="layout:borderlayout">
  <button class="buttonsample" onAction="dispImage" shortcuts = "1=1">Display Image</button>
 <container style="layout-data:bld(south);layout:inlinelayout(false,fill);align:center">
 
    </container>
</container>

                        <picture>
                        <_image >@{imgItem}</_image>
                        </picture>
 
 </scrollPane>
 

 
 <screenfirstmenu onAction="back">Back</screenfirstmenu>
 <screenSecondMenu onAction="next">Next</screenSecondMenu>
 
</screen>

I m using above given XML to get the image Displayed when pressing the button Get Image through action 'dispImage'.

I am expecting that, the possible error lie in the XML bcz, There is no any error reflected and operation executed successfully without displaying the image on screen.

kindly, Help me out make it done..

Thanks in Advance. 

 

 

Kuix technical support » How To Set Image through J2ME on the screen apart from Setting it throgh XML

Dear All !

 I am facing a very serious problem, while trying to display Images through J2me in KUIX through server. I am able to create an image but unable to set it visivble on the screen through j2me in XML, I am using several other static images through /img .. through XML that doesn't give me problem but when , I am trying to get the image throgh Server and then setting it to Screen it's create a problem.. Please, let me know the possible ways to handle the dynamic iamges and get it displayed on screen or share some similar code snippet which can solve my problem.

 Kindly, Do help me earliest.. It's very urgent !

Thanks in Advance !

 

Kuix technical support » How to invoke onFocus of the TabItems ?

Can any Body Tell me, How to trap the focus of the tabItems ? Is there any Method associated with TabItems for invoking any event on their focus change ?

Kuix technical support » Problem Regarding Display of data

Hi All !

    I am facing a problem, in displaying the data on the screen ..

I have Tried this code ..

SearchFrame.java

public class SearchFrame implements

Frame {

public static final SearchFrame instance = new SearchFrame();

DataList myList = new DataList();

ResultDataProvider  resultDetail = new ResultDataProvider();

Screen screen ;

String [][] str= {{"Hi", "Welcome To the World of Kuix !"},{"Hello !","How greatly U R enjoying It ? " }};

public void onAdded() {

screen = Kuix.loadScreen("/xml/mySearch.xml", myList );

screen.setCurrent();

}

public boolean onMessage(Object arguments, Object[] arg1)

{

if("show".equals(arguments))

{

Widget focusedWidget = screen.getFocusManager().getFocusedWidget();

if (focusedWidget instanceof ListItem)

{

DataProvider dataprovider = ((ListItem) focusedWidget).getDataProvider();

if(dataprovider !=null )

{

ResultDataProvider result = (ResultDataProvider) dataprovider;

SearchItem.instance.setResult(result);

System.out.println(result);

//searchDetail();

Kuix.getFrameHandler().pushFrame(SearchItem.instance);

}

}

return false;

}

if("search".equals(arguments))

{

for (int i=0; i<str.length ; i++)

{

myList.addItem(DataList.LIST_PROPERTRY, new ResultDataProvider(str[i][0],str [i] [1]));

}

}

return false;

}

public void

onRemoved() {

myList= null;

resultDetail = null;

screen = null;

}

}

searchItem.java

public class SearchItem implements Frame {

public static final SearchItem instance= newSearchItem();

Screen screen;

public ResultDataProvider result ;

public SearchItem()

{}

public void setResult(ResultDataProvider result) {

this.result = result;

System.out.println("<-----In Frame Search Item--------->" );

System.out.println(result.getStringValue("resultLabel"));

);

}

public void onAdded()

{ System.out.println("On Added Method" );

System.out.println(result.getStringValue("resultDetail" ));

screen= Kuix.loadScreen("/xml/searchDetail.xml", result);

screen .setCurrent(); }

public boolean onMessage(Object identifier, Object[] arg1) {

if("backPage" .equals(identifier))

{

Kuix.getFrameHandler().removeFrame(instance);

return false ;

}

return false ;

}

public void onRemoved() {

result = null;

screen = null;}

ResultDataProvider.java

Public class ResultDataProvider extends DataProvider

{

public String resultLabel;

public String resultDetail;

public ResultDataProvider(String resultLabel, String resultDetail)

{

this.resultLabel=resultLabel;

this.resultDetail=resultDetail;

}

public ResultDataProvider ()

{

}

public String getStringValue(String property) {

if("resultLabel".equals(property))

{

return resultLabel;

}

if("resultDetail".equals(property))

{

return resultDetail;

}

return super.getStringValue(property);

}

void setResultLabel(String resultLabel) {

this.resultLabel = resultLabel;

}

public void setResultDetail(String resultDetail) {

this.resultDetail = resultDetail;

}

}

DataList.java

{public static final String LIST_PROPERTRY ="results" ;}

mySearch.xml

 

screen style="layout:borderlayout">

<container style="layout-data:bld(north);layout:borderlayout">

<textfield id="myTextfield" style="layout-data:bld(center)"/>

<button style="layout-data:bld(east)" onAction="search(myTextfield.text)">GO</button>

</container>

<container style="layout-data:bld(center)">

<list>

<_renderer><![CDATA[

<listItem style="layout:borderlayout;gap:5 0" onAction="show">

<listItem><text>@{resultLabel}</text></listItem>

</listItem>

]]></_renderer>

<_items>@{results}</_items>

</list>

</container>

</

screen>

serchDetail.xml

screen>

<_title>@{resultLabel}</_title>

<scrollPane usemarkers="false" style="align:fill-center;layout:inlinelayout(false,fill);gap:1 5">

<textarea style="padding: 2 0 1 1">@{resultLabel}</textarea>

<textarea style="padding: 10 10 15 10">@{resultDetail}</textarea>

</scrollPane>

<screenfirstmenu onAction="backPage">%BACK%</screenfirstmenu>

<screenSecondMenu>

%MENU%

<menupopup>

<menuitem onAction="goHome">%HOME%</menuitem>

<menuitem onAction="exit">%EXIT%</menuitem>

</menupopup>

</screenSecondMenu>

</screen>

 

This Code runs perfectly fine .. But has a measure issue .. When Pressing Button Search .. It displayed me the first element of the String [][] .. i.e

Hi

Hello! 

Problem Occurs, when I press the Search Button multiple times .. then it just append the same value on the screen henceforth ..  in my opinion, It might be, the screen is not being cleared .. on the button event .. Plz Let me know, How can I clear the screen without removing  the page and what I should do to fix this problem?

 

 

Kuix technical support » Application re-launching at second time failed after exiting the Application

Dear All !

   I am facing a critical problem, when I am trying to re-launch the application second time after exiting the application. there is no any problem while my application is being installed on device or launced directly at Emulator.. But the problem occurs when, after terminating the application, I try to relauch my application, it's only the splash appears and the application being hanged and behaves like dummy..  It Gives me an  error set as


Error loading custom : /img/btn.png
destroyApp threw an Exception
java.lang.NullPointerException
java.lang.NullPointerException
        at com.ari.mobile.frame.MainFrame.onRemoved(MainFrame.java:375)
        at org.kalmeo.util.frame.FrameHandler.processLinkedFrameRemoveActions(FrameHandler.java:182)
        at org.kalmeo.util.frame.FrameHandler.removeAllFrames(FrameHandler.java:133)
        at org.kalmeo.kuix.core.Kuix.cleanUp(Kuix.java:92)
        at org.kalmeo.kuix.core.KuixMIDlet.destroyApp(+15)
        at javax.microedition.midlet.MIDletProxy.destroyApp(MIDletProxy.java:69)
        at com.sun.midp.midlet.Scheduler.schedule(+341)
        at com.sun.midp.main.Main.runLocalClass(Main.java:477)
        at com.sun.midp.main.Main.main(+80)

Kindly, Suggest me some appropriate solution.

Kuix technical support » Application Hanged when any Exception occurs

Hi All,

   I have developed an application which interact with the server.. My application got hanged when there exist any exception either from server or from application itself, Can any body tell me, How can I handle these exceptions ?

Thanks in Advance !

Kuix technical support » problem in removal of the current frame with List

Hi Tofu !

     I have Resolved the issue ..

          In My previous case , I was missing to set the screen of main list as default screen. It's woprking fine now .

Thanks !

 

Kuix technical support » problem in removal of the current frame with List

Hi Tofu !

   You are right , Kuix.getFrameHandler() contains a unique and static instance for all the application, I am not cretaing any nonStaic instance of the second Frame, but again the static one ..

  I am posting here the code snippet..

I hope the problem will be visible now ..

SearchFrame.java

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

public  class SearchFrame implements

 

Frame {

 

 

 

 

 

public static final SearchFrame instance = new

 

SearchFrame();

 

 

 

 

DataList

 

myList = new

 

DataList();

 

ResultDataProvider

 

resultDetail = new

 

ResultDataProvider();

 

Screen

 

screen

;

 

String [][]

 

str= {{"Hi", "Welcome To the World of Kuix !"},{"Hello !","How greatly U R enjoying It ? "

}};

 

 

 

 

 

 

 

public void

 

onAdded() {

 

 

screen = Kuix.loadScreen("/xml/mySearch.xml", myList

);

 

 

screen

.setCurrent();

}

 

 

 

 

 

 

 

 

public boolean

 

onMessage(Object arguments, Object[] arg1)

{

 

 

 

 

if("show"

.equals(arguments))

{

 

 

Widget focusedWidget =

 

screen

.getFocusManager().getFocusedWidget();

 

 

 

if (focusedWidget instanceof

 

ListItem) {

 

DataProvider dataprovider = ((ListItem) focusedWidget).getDataProvider();

 

 

 

 

 

if(dataprovider !=null

 

)

{

 

 

 

 

 

ResultDataProvider result = (ResultDataProvider) dataprovider;

 

SearchItem.

 

instance

 

.setResult(result);

 

 

System.

 

out

 

.println(result);

 

 

 

 

//searchDetail();

 

Kuix.getFrameHandler().pushFrame(SearchItem.

 

instance

 

);

 

}

 

}

 

 

 

return false

 

;

}

 

 

 

 

if("search"

.equals(arguments))

{

 

 

 

for (int i=0; i<str.length

; i++)

{

 

 

 

myList.addItem(DataList.LIST_PROPERTRY, new ResultDataProvider(str[i][0],str

[i][1]));

 

}

 

}

 

 

 

 

 

 

 

return false

 

;

}

 

 

 

 

public void

 

onRemoved() {

 

 

 

myList= null

 

;

 

 

resultDetail = null

 

;

 

 

screen = null

 

;

 

 

 

 

 

}

}

searchItem.java

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

public

 

class SearchItem implements

Frame {

 

 

 

 

 

public static final SearchItem instance= new

SearchItem();

Screen

 

screen

;

 

 

 

 

public ResultDataProvider result

;

 

 

 

public

SearchItem()

{}

 

 

 

public void

setResult(ResultDataProvider result) {

 

 

this.result

= result;

System.

 

out.println("<-----In Frame Search Item--------->"

);

System.

out.println(result.getStringValue("resultLabel"

));

);

}

 

 

 

 

 

public void

onAdded()

{ System.

 

out.println("In On Added Method"

);

System.

 

out.println(result.getStringValue("resultDetail"

));

 

 

screen= Kuix.loadScreen("/xml/searchDetail.xml", result

);

 

 

screen

.setCurrent();

}

 

 

 

public boolean

onMessage(Object identifier, Object[] arg1) {

 

 

 

if("backPage"

.equals(identifier))

{

Kuix.getFrameHandler().removeFrame(

 

instance

);

 

 

return false

;

}

 

 

 

return false

;

}

 

 

 

public void

onRemoved() {

 

 

result = null

;

 

 

screen = null

;}

ResultDataProvider.java

public

 

class ResultDataProvider extends DataProvider

{

 

public String resultLabel;

 

public String resultDetail;

 

 

 

 

public ResultDataProvider(String resultLabel, String resultDetail)

{

 

this.resultLabel=resultLabel;

 

this.resultDetail=resultDetail;

}

 

 

public ResultDataProvider ()

{

 

}

 

 

 

public String getStringValue(String property) {

 

if("resultLabel".equals(property))

 

{

 

return resultLabel;

}

 

 

if("resultDetail".equals(property))

{

 

return resultDetail;

}

 

return super.getStringValue(property);

 

}

 

void setResultLabel(String resultLabel) {

 

this.resultLabel = resultLabel;

}

 

 

public void setResultDetail(String resultDetail) {

 

this.resultDetail = resultDetail;

}

 

}

DataList.java

 

 

 

public

 

 

public static final String LIST_PROPERTRY ="results"

;}

mySearch.xml

class DataList extends  DataProvider

{

 

 

<

screen style="layout:borderlayout">

 

<container style="layout-data:bld(north);layout:borderlayout">

 

<textfield id="myTextfield" style="layout-data:bld(center)"/>

 

<button style="layout-data:bld(east)" onAction="search(myTextfield.text)">GO</button>

 

</container>

 

<container style="layout-data:bld(center)">

 

<list>

 

<_renderer><![CDATA[

<listItem style="layout:borderlayout;gap:5 0" onAction="show">

<listItem><text>@{resultLabel}</text></listItem>

</listItem>

 

]]></_renderer>

 

<_items>@{results}</_items>

 

</list>

 

</container>

</

screen>

 

serchDetail.xml

<

screen>

 

<_title>@{resultLabel}</_title>

 

 

<scrollPane usemarkers="false" style="align:fill-center;layout:inlinelayout(false,fill);gap:1 5">

 

 

<textarea style="padding: 2 0 1 1">@{resultLabel}</textarea>

 

<textarea style="padding: 10 10 15 10">@{resultDetail}</textarea>

 

 

 

</scrollPane>

 

<screenfirstmenu onAction="backPage">%BACK%</screenfirstmenu>

 

<screenSecondMenu>

%MENU%

 

<menupopup>

 

 

<menuitem onAction="goHome">%HOME%</menuitem>

 

<menuitem onAction="exit">%EXIT%</menuitem>

 

</menupopup>

 

</screenSecondMenu>

 

 

 

</

screen>

 

 

Above Given Code snippet work fine .. it gives me list on search though String str[i][0], onAction of this selected ListItem again It gives me the value of str[i][1] in sublist,

The Problem comes in picture when, I am trying to return back to the list of str[i][0]  from sublist str[i][1]; The Application slightly behaves idle when , I am pressing back to return the mainList.

How do  I can  return to the mainList, from the sublist ? I Hope , My problem Will be clear to You now .

 

 

 

Kuix technical support » problem in removal of the current frame with List

Hi All !

I am using a list, onAction of the List Item , I am having a sub List on seperate widget with a seperate framehandler. I am facing problem while I am trying to remove the current Frame, to return back on the ListWidget.

For Removing the current frame I am using

 

 

Kuix.getFrameHandler().removeFrame(

instance);

 

 

return false;

Please Help me out for resolving this issue.

Thanks !

 

  

Kuix technical support » Simple TextField in Kuix like J2me

Dear All !

       I am trying to have very simple controls like TextField for username as well as Password fileds similar to J2me TextFields instead Of having new Dialoge or new windowpage. Is there any alternative for having this facilty in Kuix ? Please , Let me  know also, How can I use simple J2me controls along with KUIX in any application development ?

Thanks !  

 

Kuix technical support » Problem in running the application in NetBeans

Hi Tofu !

    Yeah , U R Right ..  By mistake I had taken a standard xml document . which is having this <root> tag by default. It's now working fine ..

Thanks For this Quick Response.  

Kuix technical support » Problem in running the application in NetBeans

Hi All !

    I am getting a problem , While I am trying to run an application in NetBeans.

I am getting these following error at run time ..

startApp threw an Exception
java.lang.IllegalArgumentException: Unknow tag : root
        at org.kalmeo.kuix.core.Kuix$1.startElement(Kuix.java:379)
        at org.kalmeo.util.xml.LightXmlParser.parse(LightXmlParser.java:214)
        at org.kalmeo.kuix.core.Kuix.parseXml(Kuix.java:305)
        at org.kalmeo.kuix.core.Kuix.loadXml(Kuix.java:195)
        at org.kalmeo.kuix.core.Kuix.loadScreen(Kuix.java:119)
        at org.kalmeo.kuix.core.Kuix.loadScreen(Kuix.java:107)
        at com.arieon.mobile.frame.SearchFrame.onAdded(SearchFrame.java:34)
        at org.kalmeo.util.frame.FrameHandler.pushFrame(FrameHandler.java:100)
        at com.arieon.mobile.N2RMobile.initDesktopContent(N2RMobile.java:22)
        at org.kalmeo.kuix.core.KuixCanvas.initialize(+151)
        at org.kalmeo.kuix.core.KuixMIDlet.startApp(+102)
        at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:44)
        at com.sun.midp.midlet.Scheduler.schedule(+270)
        at com.sun.midp.main.Main.runLocalClass(+28)

        at com.sun.midp.main.Main.main(+80)
Execution completed.

where I am having

N2RMobile.java

public class N2RMobile extends KuixMIDlet{
   
   
    protected void initDesktopContent(Desktop arg0) {
  //Kuix.getFrameHandler().pushFrame(N2RMobileMainFrame.instance);
  Kuix.getFrameHandler().pushFrame(SearchFrame.instance);

 }

 protected void initDesktopStyles() {
  Kuix.loadCss("/css/style.css");
 }

SerachFrame.java

public class SearchFrame implements Frame {

   
public static final SearchFrame instance = new SearchFrame();
 
 DataProvider myDataProvider = new DataProvider();
 DataList myList = new DataList();
 
 Screen screen;
 
String []str= {"Hello", "Kuix","!"}

 public void onAdded() {
  
  screen= Kuix.loadScreen("/xml/mySearch.xml", myList);
  screen.setCurrent();

 }

 public boolean onMessage(Object arguments, Object[] arg1)
 {
  if("search".equals(arguments))
  {
   
   for(int i=0; i<str.length;i++)
     
   myList.addItem(DataList.LIST_PROPERTY,new ResulDataProvider(str [i] );
   
   myList.addItem(DataList.LIST_PROPERTY,new ResulDataProvider("Hello") );
   myList.addItem(DataList.LIST_PROPERTY,new ResulDataProvider("Test") );
    }
   
   //myDataProvider.addItem(, new ResulDataProvider("Hi"));
  }
  
  
  return false;
 }

I have already tried for both relative as well as absolute path parameters.

Please help me out to Identify this running issue .

 

 

   

Kuix technical support » Dynamically displaying String [ ][ ] into a growing List

Hi All !

    I am facing some problem while trying to display the data through String [][] str into a list dynamically. Can any body give me any hint , How do i can solve this issue ? additionally, If any body throw some more light on inter DataProvider communication as well as relationship, It will be enjoyable.

Thanks in advance.

  

Kuix technical support » Unable to get the selected Value through choice RadioGroup

Thanks Tofu !

     Me too have resolve the issue ..  Thanks For this Quick Risponse ..

Kuix technical support » Unable to get the selected Value through choice RadioGroup

Hi Tofu !

     Thanks For Reply,  I have already tried out Value attribute too , But Unable to get this selected value 1, 2 0r 3 through

<choice >
  <choiceRadiogroup id="chGroup1" >

     <radiobutton selected="true" >1</radiobutton>
     <radiobutton>2</radiobutton>
     <radiobutton>3</radiobutton>
    
  </choiceRadiogroup>
</choice

<button onAction "action(#chGoup1.value)" >%ACTION%</button>

in my Frame.

String ComboValue= (String) arguments[0];

Is there some thing which , I am missing still ? presently , it's Giving me null ..