Android Basic Alternative


Closed Thread
Results 1 to 32 of 32

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Sure - I've produced a display program for a PIC project that is basically collecting sensor data and sending it by BlueTooth. The Android app reads and displays the data, and saves me carrying a laptop for a task a phone can happily do. I have not hit any real limitations with the language other than my imagination. I did uncover a bug and got a load with a fix within a few hours, which is way better than I'd see with a proprietary product.

    All the major constructs are there, and all the smart phone platform advantages are accessible like BlueTooth, WIFI, position/motion sensors, GPS, file reads and writes, etc. as well as graphics tools and text dislay tools, and there are tools to produce standalone apps for distribution in Google Play. I guess my only concern is the double edged sword of open source and GPL - you get lots of code to reuse, but you must publish your source so you might lose any competitive advantage. Perfect for a hobbyist, and still usable commercially with caution.

    Not a lot of posts, though, so I'm guessing not a lot of PBP folks are using it - or maybe not even doing Android.

  2. #2
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Does RFO basic include the advanced feature of "Ad Hoc WiFi" or point to point WiFi?

    Norm

  3. #3
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Hi Norm. I'm not sure - I have not played with WIFI yet. In general RFOB uses the android/java/linux existing infrastructure to set up physical or transport layer stuff, then uses sockets or defined buffer accesses to move data in and out of those layers. So if your version of Android supports PTP WIFI (I don't think my old 2.3.3 does) you should be able to use it. RFOB really wraps the existing Java and hides the complexity to get you going fast without a huge learning curve.

    But I'm pretty much a newbie too... I'm just looking for something that doesn't require me to write a dozen pages of objects to type "hello World" on the screen. B4A is nice for a big collaborative projects, but I don't generally do any of those. RFOB might just serve all of my needs. The manual is quite good. I'm not sure about other language alternatives if they even exist, hence my original post.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Quote Originally Posted by Charlie View Post
    Not a lot of posts, though, so I'm guessing not a lot of PBP folks are using it - or maybe not even doing Android.
    From what I have seen I do not think that there are that many here working with Android.

    I am going to try RFOB when I get time. Not sure when that will be though.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Quote Originally Posted by mackrackit View Post
    From what I have seen I do not think that there are that many here working with Android.
    Well, I have been using Basic4Android for a while. Unlike Charlie, I do like the fact that the program is object oriented. I think that it been object oriented it makes my life much easier.

    Robert
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  6. #6
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    I also am using B4A, though only a few simple apps so far. Learning how to make your app work with different screen sizes has been my biggest hurdle. Still having trouble with that I will check out RFO basic. Thanks for the link.
    Shawn

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    I have been working with B4A for a couple of months and like it. Now trying to get PIC connected to a BT module to talk in Prefix mode. If any of you guys have experience I would appreciate some input.

    I define all variables as BYTES. B4A crashes when it receives the data.
    Code:
    Send_BT:
      Prefix1=0
      Prefix2=0
      Prefix3=0
      Prefix4=4
      RPM1T=34
      RPM2T=65
      RPM3T=232
      RPM4T=45
      debug Prefix1,Prefix2,Prefix3,Prefix4,RPM1T,RPM2T,RPM3T,RPM4T
    Return

  8. #8
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Did you ever get this working with prefix mode? I am struggling with the exact same thing. I can view the data with prefix disabled, but it crashes (doesn't like the prefix) when using prefix mode. Any tips appreciated.
    Shawn

  9. #9


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    I did get it working. The one thing that was kicking my ass if I remember right was the True/False for BigEndian.

    Code:
    AStream.InitializePrefix(Main.serial1.InputStream, True, Main.serial1.OutputStream, "AStream")
    Also I had to look around to set the BPS right. I am sending at 9600 currently

    Code:
    Incoming= BytesToString(Buffer, 0, Buffer.Length, "ISO8859_1")
    Here is the PBP side of the Bluetooth TX

    Code:
    Send_BT: 'Sends data assembled from control boards and outputs to the XOOM
      RPM1R=RPM1R+1000                                
      RPM2R=RPM2R+1000',2
      RPM3R=RPM3R+1000'1
      RPM4R=RPM4R+1000'0
      RPM5R=RPM5R+1000                                   
      RPM6R=RPM6R+1000
      RPM7R=RPM7R+1000
      RPM8R=RPM8R+1000
      RPM9R=RPM9R+1000
      RPM10R=RPM10R+1000
      RPM11R=RPM11R+1000
      RPM12R=RPM12R+1000
      RPM13R=RPM13R+1000
      RPM14R=RPM14R+1000
      RPM15R=RPM15R+1000
      RPM16R=RPM16R+1000
      RPM17R=RPM17R+1000
      RPM18R=RPM18R+1000
      RPM19R=RPM19R+1000
      RPM20R=RPM20R+1000
      RPM21R=RPM21R+1000
      RPM22R=RPM22R+1000
      RPM23R=RPM23R+1000
      RPM24R=RPM24R+1000  
      Prefix1=248
      Prefix2=0
      Prefix3=0
      Prefix4=0
      RadarTotal=radartotal+1000
      debug Prefix1,Prefix2,Prefix3,Prefix4,"R,",dec4 RadarTotal,",",dec4 RPM1R,",",dec4 RPM2R,",",dec4 RPM3R,",",dec4 RPM4R,",",dec4 RPM5R,",",dec4 RPM6R,",",dec4 RPM7R,",",dec4 RPM8R,",",dec4 RPM9R,",",dec4 RPM10R,_
                                                           ",",dec4 RPM11R,",",dec4 RPM12R,",",dec4 RPM13R,",",dec4 RPM14R,",",dec4 RPM15R,",",dec4 RPM16R,",",dec4 RPM17R,",",dec4 RPM18R,_
                                                           ",",dec4 RPM19R,",",dec4 RPM20R,",",dec4 RPM21R,",",dec4 RPM22R,",",dec4 RPM23R,",",dec4 RPM24R,",",dec4 RPM1R,",",dec4 RPM2R,_
                                                           ",",dec4 RPM3R,",",dec4 RPM4R,",",dec4 RPM5R,",",dec4 RPM6R,",",dec4 RPM7R,",",dec4 RPM8R,",",dec4 RPM9R,",",dec4 RPM10R,_
                                                           ",",dec4 RPM11R,",",dec4 RPM12R,",",dec4 RPM13R,",",dec4 RPM14R,",",dec4 RPM15R,",",dec4 RPM16R,",",dec4 RPM17R,",",dec4 RPM18R,_
                                                           ",",dec4 RPM19R,",",dec4 RPM20R,",",dec4 RPM21R,",",dec4 RPM22R,",",dec4 RPM23R,",",dec4 RPM24R,",","E"
      'serout2 lcd,16468,[Prefix,CursorPS,0,dec RPM1T,",",dec RPM2T,",",dec RPM3T,",",dec RPM4T]
    Return
    Here is the Bluetooth RX side on the Xoom/B4A

    Code:
    Sub AStream_NewData (Buffer() As Byte)
    	'Log( BytesToString(Buffer, 0, Buffer.Length, "ISO8859_1"))    
    	Dim Incoming As String
    	Dim Start As Int
    	Dim Stop As Int
    	'sAmount As Int
        'LogMessage("INTERFACE", BytesToString(Buffer, 0, Buffer.Length, "ISO8859_1"))
    	Log( BytesToString(Buffer, 0, Buffer.Length, "ISO8859_1"))
    	Incoming= BytesToString(Buffer, 0, Buffer.Length, "ISO8859_1")
        Start = Incoming.IndexOf("R")
    	Stop = Incoming.IndexOf("E")
    
    	If ScrId>3 Then
    	''''''''''
    	If SimSpeedYN="Yes" Then 
    	  MPH = SimSpeed
    	  MaxRPM=(30/PC)*(RS/30)*(MPH)*0.168*(txtMasterPop.text/1000)
    	  txtRPM.Text = NumberFormat(MaxRPM,0,1)
    	 Else
          MPH = (Incoming.SubString2(Start +2,Stop -241))
    	  'If MPH>0 Then 
            MPH=(MPH-1000)          '''''''''THis is for hard coded MPH
    	    MPH=Radar/MPH
    	    txtMPH.Text=NumberFormat(MPH,0,1)
            MaxRPM=(30/PC)*(RS/30)*(MPH)*0.168*(txtMasterPop.text/1000)
    	    txtRPM.Text = NumberFormat(MaxRPM,0,1)
    			    'MPH="0"
    	    'txtMPH.Text=0
          ' Else
    	   ' MPH="0"
    	   ' txtMPH.Text=0
    	   ' txtRPM.Text = 0	
    	  'End If
    	End If   
    	  
    	Log("MPH " & MPH)
          If EPD>0 Then
    	    If MPH>0 Then 
     	      Row1 = (Incoming.SubString2(Start +7,Stop -236))
    	      Row2 = (Incoming.SubString2(Start +12,Stop -231))
    	      Row3 = (Incoming.SubString2(Start +17,Stop -226))
    	      Row4 = (Incoming.SubString2(Start +22,Stop -221))
    	      txtRow1.Text = NumberFormat(((Row1-1000)/(((30/PC)*(RS/30)*MPH*0.168)*10)),0,2)
    	      txtMR1.Text=   NumberFormat((((txtRow1.Text*1000)/txtMasterPop.Text)),1,3)
    	      txtRow2.Text = NumberFormat(((Row2-1000)/(((30/PC)*(RS/30)*MPH*0.168)*10)),0,2)
    	      txtMR2.Text=   NumberFormat((((txtRow2.Text*1000)/txtMasterPop.Text)),1,3)
    	      txtRow3.Text = NumberFormat(((Row3-1000)/(((30/PC)*(RS/30)*MPH*0.168)*10)),0,2)
    	      txtMR3.Text=   NumberFormat((((txtRow3.Text*1000)/txtMasterPop.Text)),1,3)
    	      txtRow4.Text = NumberFormat(((Row4-1000)/(((30/PC)*(RS/30)*MPH*0.168)*10)),0,2)
    	      txtMR4.Text=   NumberFormat((((txtRow4.Text*1000)/txtMasterPop.Text)),1,3)
    		 Else
    	      txtRow1.Text=0
    	      txtMR1.Text=0
    	      txtRow2.Text=0
    	      txtMR2.Text=0
    	      txtRow3.Text=0
    	      txtMR3.Text=0
    	      txtRow4.Text=0
    	      txtMR4.Text=0		 
    		End If
    		Dim MPHTest As Short
    		MPHTest=0
    		txtMPHZ.Text=MPHTest
          End If 
          If EPD>1 Then 
     	    Row5 = (Incoming.SubString2(Start +27,Stop -216))
    	    Row6 = (Incoming.SubString2(Start +32,Stop -211))
    	    Row7 = (Incoming.SubString2(Start +37,Stop -206))
    	    Row8 = (Incoming.SubString2(Start +42,Stop -201))
    	    txtRow5.Text = NumberFormat(((Row5-1000)/(((30/PC)*(RS/30)*MPH*0.168)*10)),0,2)
    	    txtMR5.Text=   NumberFormat((((txtRow5.Text*1000)/txtMasterPop.Text)),1,3)
    	    txtRow6.Text = NumberFormat(((Row6-1000)/(((30/PC)*(RS/30)*MPH*0.168)*10)),0,2)
    	    txtMR6.Text=   NumberFormat((((txtRow6.Text*1000)/txtMasterPop.Text)),1,3)
    	    txtRow7.Text = NumberFormat(((Row7-1000)/(((30/PC)*(RS/30)*MPH*0.168)*10)),0,2)
    	    txtMR7.Text=   NumberFormat((((txtRow7.Text*1000)/txtMasterPop.Text)),1,3)
    	    txtRow8.Text = NumberFormat(((Row8-1000)/(((30/PC)*(RS/30)*MPH*0.168)*10)),0,2)
    	    txtMR8.Text=   NumberFormat((((txtRow8.Text*1000)/txtMasterPop.Text)),1,3)
          End If
     end sub
    To make sure I was calculating the Prefix right I found this website that allowed me to type in data and it would calculate the size for me
    http://mothereff.in/byte-counter
    Last edited by Tobias; - 16th March 2013 at 01:22.

Similar Threads

  1. Android Basic
    By dhouston in forum Off Topic
    Replies: 14
    Last Post: - 16th February 2013, 02:47
  2. Pic to Android
    By l_gaminde in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th January 2012, 19:08
  3. PBP & Android Interfacing
    By lester in forum PBP & Amicus18
    Replies: 5
    Last Post: - 13th May 2011, 22:41
  4. PICs and Android
    By ardhuru in forum General
    Replies: 3
    Last Post: - 17th November 2010, 06:41
  5. Pulsin alternative
    By sbobowski in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th October 2008, 09:21

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts