Concerning Android's built-in Java GUI system and the XML config
stuff, I was more going to use the API like the following.  Basically
I am going to issue an HTTP POST, receive back a JSON "form", and
dynamically compose the screen.  Then when the user does something
(i.e. clicks a button) I will communicate back to the server the event
that occurred. You could almost think of it as a lightweight browser
that allows you to use native Android UI Widgets.  Do you know if
anybody else has already gone before me and developed something like
this?

        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);

                List<NameValuePair> nvps = new ArrayList<NameValuePair>();
                // nvps.add(new BasicNameValuePair("screen", "login"));

                String result = 
connect("http://red.rpg-xml.com/oru11web/orudroid2";, nvps);

                try {
                        JSONObject json = new JSONObject(result);
                        JSONArray topElems = json.names();
                        for (int i1 = 0; i1 < topElems.length(); i1++) {
                                if (topElems.getString(i1).equals(TYP_FORM)) {
                                        JSONObject form = 
json.getJSONObject("FORM");

                                        // Create form
                                    sv = new ScrollView(this);
                                        LinearLayout ll = new 
LinearLayout(this);
                                        
ll.setOrientation(LinearLayout.VERTICAL);
                                        sv.addView(ll);

                                        JSONArray fldLst = 
form.getJSONArray(TYP_FLDLST);
                                        for (int i2 = 0; i2 < fldLst.length(); 
i2++) {
                                                JSONObject fld = 
fldLst.getJSONObject(i2);
                                                if 
(fld.get(TYP).equals(TYP_BTN)) {
                                                        UIButton b = new 
UIButton(this);
                                                        
b.setText(fld.getString(VALUE));
                                                        
b.setOnClickListener(new OnClickListener() {
                                                            @Override
                                                            public void 
onClick(View v) {
                                                              processEvent(v);
                                                            }
                                                          });
                                                        
b.setAction(fld.getString(ACTION));
                                                        ll.addView(b);
                                                } else if 
(fld.get(TYP).equals(TYP_TXTFLD)) {
                                                        EditText et = new 
EditText(this);
                                                        
et.setText(fld.getString(VALUE));
                                                        ll.addView(et);
                                                } else if 
(fld.get(TYP).equals(TYP_LBL)) {
                                                        TextView tv = new 
TextView(this);
                                                        
tv.setText(fld.getString(VALUE));
                                                        ll.addView(tv);
                                                }
                                        }
                                        this.setContentView(sv);
                                } else {
                                        // Not implemented.
                                }
                        }
                } catch (JSONException e) {
                        e.printStackTrace();
                }
        }

Aaron Bartell
http://mowyourlawn.com
http://mowyourlawn.com/blog/



On Mon, Oct 4, 2010 at 3:29 PM, Jeffrey Kesselman <[email protected]> wrote:
> Ah.  I see.
>
> Well Im not doing that sort of development so I'm afraid I can't help
> much with suggestions.
>
> I HAVE used ExtJS which is part of the new Sensa platform, but i
> haven't sued their "touch" package.
> ExtJS can use JSON to define its interface.
>
> Revolution's LiveCode I believe also supports Android and iOS, but
> doesnt have that sort of data-driven interface mdoel exposed to the
> best of my knwoeldge.
>
> Ofcourse you could also use Android's built in Java GUI system, which
> is XML driven.
>
> Regards
>
> JK
>
> On Mon, Oct 4, 2010 at 4:00 PM, Aaron Bartell <[email protected]> wrote:
>> Hi Jeff,
>>
>> Thanks for the response.  Yes, I know *how* to do it, I was just
>> curious if others were doing it also - mostly so I could pick other's
>> brains on best practices and such.  The IBM i (fka AS/400, then
>> iSeries, then System i5) is used by many "mainframe" sized companies
>> that do a lot of data driven style applications and I am curious to
>> know how people are delivering data to the android device.  I have
>> begun to dip my toes into SenchaTouch and that seems to work ok.  I
>> have also looked into delivering meta-data style forms via JSON to the
>> android device and have the form rendered on the fly.  This approach
>> would be taken to lessen the amount of android/client-side development
>> needing to take place and instead all the screen/panel definitions
>> would be stored on the server (makes deployment a breeze). Again, my
>> approach is mostly for data driven/data entry apps and NOT for the
>> whizbang apps like TalkTom or Games or weather.
>>
>> I do agree that a lot of what I am talking about is server agnostic,
>> but it never hurts to find other souls that are operating on the same
>> server/language environment :-)
>>
>> Thanks again for responding,
>> Aaron Bartell
>>
>>
>>
>> On Mon, Oct 4, 2010 at 2:42 PM, Jeffrey Kesselman <[email protected]> wrote:
>>> Im not sure what you mean.
>>>
>>> Android supports true TCP/IP sockets.  So anything that can serve a
>>> TCP socket should be able to communicate with an Android phone.
>>>
>>> On Mon, Oct 4, 2010 at 1:46 PM, Aaron Bartell <[email protected]> 
>>> wrote:
>>>> I am new to this forum and am curious to know if anybody is developing
>>>> Android apps that communicate with the RPG language on IBM i?
>>>>
>>>> I didn't see any mention of it in the archives, which is why I ask.
>>>>
>>>> AaronBartell.com
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups 
>>>> "Android Discuss" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to 
>>>> [email protected].
>>>> For more options, visit this group at 
>>>> http://groups.google.com/group/android-discuss?hl=en.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> It's always darkest just before you are eaten by a grue.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Android Discuss" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to 
>>> [email protected].
>>> For more options, visit this group at 
>>> http://groups.google.com/group/android-discuss?hl=en.
>>>
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Android Discuss" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> For more options, visit this group at 
>> http://groups.google.com/group/android-discuss?hl=en.
>>
>>
>
>
>
> --
> It's always darkest just before you are eaten by a grue.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Android Discuss" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/android-discuss?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en.

Reply via email to