Google App Inventor


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    448

    Default Google App Inventor

    Wondering if anyone has any experience with the Google App Inventor?

    I'd like to build a very simple app that displays a numeric keypad, and then simply outputs it to the phone's bluetooth.

    Apparently from what I read, the App Inventor is a very simple package to develop Android apps, without having to go the Eclipse way. Also pretty much designed for the hobbyist, as it has canned commands to control Lego Mindstorms, letting you use all sensors on the Android in your project.

    Would love to share information if anyone's been at it.

    Regards,

    Anand Dhuru

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


    Did you find this post helpful? Yes | No

    Default Re: Google App Inventor

    The App Inventor is/was "OK", but the future of it is questionable. Google is shutting it down. MIT is going to do something with it though. The way it is with Google everything is online, that may or may not be a good thing. It also seemed to be a bit limited in what you could do, IMHO. Kind of like using a "site builder" for a web site.

    Have you seen B4A?
    http://www.basic4ppc.com/index.html
    I am really liking it. One of the nice features is the ability to debug on a device over your lan.

    If you do decide to go with B4A use coupon code "bovvkr" to get %50 off the enterprise edition.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: Google App Inventor

    Thanks for the information, Dave.

    The main thing that atrracted me to App Inventor was the ease with which one can use modules like BT, light sensor, accelerometer and so on, especially BT. How easy is it to use bluetooth with B4A? Have you used it?

    At the price though, after the discount, it does look too tempting to pass.

    BTW, as of September XX, I believe App Inventor is now hosted on the MIT server, and fully usable, so the accessibility should not be a problem, at least in the near future.

    If you have used B4A, I would love to know your specific usage(s), as also about the learning curve, before I take the plunge.

    Regards,

    Anand

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


    Did you find this post helpful? Yes | No

    Default Re: Google App Inventor

    I have not used BT yet. Used the GPS, compass/accelerometer, write/read to storage... Currently I am working on a database app for an archaeologist that will record position and user entered attributes, with the ability to sync the data once the device is back into cell/wifi range. The learning curve for me was less than App Inventor. I never really made anything useful with App Inventor... But that is me.

    Here is the code for a test app when I started playing with the GPS and the other orientation things.
    The apk is attached if you want to see what it does.
    Code:
    'Activity module
    Sub Process_Globals
        'These global variables will be declared once when the application starts.
        'These variables can be accessed from all modules.
        Dim GPS1 As GPS
        Dim Orientation As PhoneOrientation
        'Compass Stuff
        Dim Angle As Float                
        Dim Timer1 As Timer
    End Sub
    
    
    Sub Globals
        'These global variables will be redeclared each time the activity is created.
        'These variables can only be accessed from this module.
        Dim Button1 As Button
        Dim Button2 As Button
        Dim Button3 As Button
        Dim Button4 As Button
        Dim ScrollView1 As ScrollView
        Dim lblAcu As Label
        Dim lblAlt As Label
        Dim lblLat As Label
        Dim lblLon As Label
        Dim lblSatellites As Label
        Dim lblSpeed As Label
        Dim pnlTest As Panel
        Dim Alt    As    Double
        Dim Rate As Double
        Dim Acu As Double
        Dim Latx As Double
        Dim Lonx As Double
        Dim now As Long
        Dim lblBear As Label
        Dim lblCompass As Label
        'Compass Stuff
        Dim csvCompass, csvNeedle As Canvas
        Dim bmpCompass, bmpNeedle As Bitmap
        Dim imvCompass, imvNeedle As ImageView
        Dim RectCompass, SRectNeedle, DRectNeedle As Rect
        
        
    End Sub
    
    
    Sub Activity_Create(FirstTime As Boolean)
        Activity.LoadLayout("Main")
        ScrollView1.Panel.LoadLayout("scrollviewlayout")
        ScrollView1.Panel.Height = pnlTest.Height
        EditMode
        If FirstTime Then
            GPS1.Initialize("GPS")
        End If
        If File.ExternalWritable = True Then 
            Msgbox("Can write to SD storage card!", "") 
            Return 
        End If
        WriteTextWriter
    End Sub
    
    
    Sub Activity_Resume
        If GPS1.GPSEnabled = False Then
            ToastMessageShow("Please enable the GPS device.", True)
            StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
        Else
            GPS1.Start(0, 0) 'Listen to GPS with no filters.
        End If
        Orientation.StartListening("Orientation")
    End Sub
    
    
    Sub Activity_Pause (UserClosed As Boolean)
        GPS1.Stop
        Orientation.StopListening
    End Sub
    Sub GPS_LocationChanged (Location1 As Location)
        lblLat.Text = "Lat = " & Location1.ConvertToMinutes(Location1.Latitude)
        lblLon.Text = "Lon = " & Location1.ConvertToMinutes(Location1.Longitude)
        Latx = Location1.Latitude
        Lonx = Location1.Longitude
        ' 1 meter per second = 2.23693629 miles per hour
        Rate = Round2(Location1.Speed * 2.23693629,3)
        lblSpeed.Text = "Speed (MPH)= " & Rate
        ' 1 meter = 3.2808399 feet
        Alt = Round2(Location1.Altitude * 3.2808399,3)
        lblAlt.Text = "Altitude (Feet)= " & Alt
        Acu = Round2(Location1.Accuracy * 3.2808399,3)
        lblAcu.Text = "Accuracy (Feet)= " & Acu
        lblBear.Text = "GPS Bearing = " & Location1.Bearing
    End Sub
    
    
    Sub GPS_UserEnabled (Enabled As Boolean)
        ToastMessageShow("GPS device enabled = " & Enabled, True)
    End Sub
    
    
    Sub GPS_GpsStatus (Satellites As List)
        lblSatellites.Text = "Satellites:" & CRLF & _
        "#  SNR Used  Azi  Elev" & CRLF
        For i = 0 To Satellites.Size - 1
            Dim Satellite As GPSSatellite
            Satellite = Satellites.Get(i)
            lblSatellites.Text = lblSatellites.Text & CRLF & Satellite.Prn & _
                "  " & Satellite.Snr & "  " & Satellite.UsedInFix & "  " & Satellite.Azimuth _ 
                & "  " & Satellite.Elevation
        Next
    End Sub
    Sub Button1_Click
          WriteTextWriter
          Msgbox("The date is: " & DateTime.Date(now) & CRLF & _
        "The time is: " & DateTime.Time(now), "") 
    End Sub
    Sub Button2_Click
        ReadStringExample
    End Sub
    
    
    Sub ReadStringExample 
        Msgbox(File.ReadString(File.DirRootExternal, "MAC_GPS.txt"), "") 
    End Sub 
    Sub WriteTextWriter() 
        
        now = DateTime.Now
        Dim TextWriter1 As TextWriter 
        TextWriter1.Initialize(File.OpenOutput(File.DirRootExternal,"MAC_GPS.txt", True)) 
      '  For i = 1 To 10 
      '      TextWriter1.WriteLine("Line" & i) 
      '  Next 
          TextWriter1.WriteLine("Date = " & DateTime.Date(now))
        TextWriter1.WriteLine("Time = " & DateTime.Time(now))
        TextWriter1.WriteLine("Lat = " & Latx)
        TextWriter1.WriteLine("Lon = " & Lonx)
        TextWriter1.WriteLine("Alt = " & Alt)
        TextWriter1.WriteLine(" ")
        TextWriter1.Close 
    End Sub 
    Sub Orientation_OrientationChanged (Azimuth As Float, Pitch As Float, Roll As Float)
        lblCompass.Text = "Compass = " & Azimuth
        Angle = Azimuth
        Timer1_Tick
    End Sub
    Sub Timer1_Tick
        csvNeedle.DrawRectRotated(DRectNeedle,Colors.Transparent,True,1,0)
        csvNeedle.DrawBitmapRotated(bmpNeedle,SRectNeedle,DRectNeedle,0)
        csvCompass.DrawBitmapRotated(bmpCompass,RectCompass,RectCompass,-Angle)
        imvCompass.Invalidate2(RectCompass)
    End Sub
    Sub EditMode()
        'Compass Stuff
        Dim x, y As Float
    
    
        bmpCompass.Initialize(File.DirAssets,"compass.png")
        bmpNeedle.Initialize(File.DirAssets,"needle.png")
        
        imvCompass.Initialize("")
        imvCompass.Bitmap = bmpCompass
        imvNeedle.Initialize("")
        imvNeedle.Color=Colors.Transparent
        
        x = 30 ' (100%x - bmpCompass.Width)/2
        y = 410 '(100%y - bmpCompass.Height) / 2
        ScrollView1.Panel.AddView(imvCompass, x, y, bmpCompass.Width, bmpCompass.Height)
        ScrollView1.Panel.AddView(imvNeedle, x, y, bmpCompass.Width, bmpCompass.Height)
        csvCompass.Initialize(imvCompass)
        RectCompass.Initialize(0, 0, bmpCompass.Width, bmpCompass.Height)
    
    
        csvNeedle.Initialize(imvNeedle)
        x = (bmpCompass.Width - bmpNeedle.Width)/2
        y = (bmpCompass.Height - bmpNeedle.Height)/2
        SRectNeedle.Initialize(0, 0, bmpNeedle.Width, bmpNeedle.Height)
        DRectNeedle.Initialize(x, y, x + bmpNeedle.Width, y + bmpNeedle.Height)
        
        Timer1.Initialize("Timer1",200)
        Timer1_Tick
        
    End Sub
    Attached Files Attached Files
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default Re: Google App Inventor

    Anand,

    I've been too busy with 15 different PCB prototypes to spend much time with B4A so I can't add to what Dave has said but everyone I know who has it has been impressed. There's a user forum that should give you a good idea of how it is used and how well it is supported. Anybody familiar with any dialect of procedural Basic (and especially VB) should find it easy to learn.

  6. #6
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: Google App Inventor

    Dave (macrackit), thanks for the code; a working piece of code should be an excellent starting point while learning.

    Dave (Houston), I remember you had referred to B4A in an earlier thread as well, and had meant to try it out back then, but somehow got relegated to the background. I see from the forums and the projects sub-section that people have done some pretty fancy things with B4A. What I need seems pretty trivial in comparison, so I'm pretty sure its doable.

    I'll report back with the progress as I go.

    Thanks, guys.

    Anand

Members who have read this thread : 1

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