Autor Tema: Basic4Android Programen en BASIC sus programas Android  (Leído 19352 veces)

0 Usuarios y 1 Visitante están viendo este tema.

79137913

  • Megabyte
  • ***
  • Mensajes: 185
  • Reputación: +21/-4
  • 4 Esquinas
    • Ver Perfil
    • Eco.Resumen Resumenes Cs. Economicas
Basic4Android Programen en BASIC sus programas Android
« en: Octubre 31, 2011, 03:34:04 pm »
HOLA!!!

El programa es pago, pero se puede conseguir lo saben :P
[REQUIERE]
JAVA SDK
ANDROID SDK
[/REQUIERE]


Citar
Basic4android es un entorno de desarrollo simple pero poderoso que se dirige a los dispositivos Android.
Basic4android idioma es similar al lenguaje Visual Basic con el apoyo adicional de los objetos.
Basic4android aplicaciones compiladas son nativos de las aplicaciones de Android, no hay tiempos de ejecución adicionales o dependencias.
A diferencia de otros IDEs Basic4android está 100% enfocada en el desarrollo de Android.
Basic4android incluye un diseñador de gran alcance de GUI con soporte integrado para múltiples pantallas y orientaciones. No es necesario escribir XML.
Usted puede desarrollar y depurar con el emulador de Android o con un dispositivo real (o USB conectado en la red local).
Basic4android tiene un rico conjunto de bibliotecas que facilitan el desarrollo de aplicaciones avanzadas.
Esto incluye: bases de datos SQL, GPS, puertos serie (Bluetooth), la cámara, el análisis de XML, servicios Web (HTTP),
Servicios (tareas en segundo plano), JSON, Animaciones, red (TCP y UDP), texto a voz (TTS), reconocimiento de voz, WebView, AdMob (anuncios), Gráficas, OpenGL, gráficos y mucho más.

Algo que no esta ahi es que las aplicaciones son 100% android nativo, asi que van a funcionar en cualquier  android post version 2.

Pagina OFICIAL

EDIT:

Agrego tabla de migracion VB6 to B4A
Código: (vb) [Seleccionar]
This file is primarily for reference when converting Visual Basic 6 source code to B4A.
  VB6                  B4A
  ===                  ===
controls            Views  (button, edittext, label, etc.)
In the VB6 code window, the top left drop-down list contains all
the controls you have placed in the current form and the right list
contains all the events for each control.  The equivalent in B4A can
be found by clicking on Designer - Tools - Generate Members. Once
you have created Subs in the program coding window, the tab "Modules"
on the right side will list each of the Subs.
In B4A, you start by typing "Sub [viewName]" followed by a space and
follow the prompts, pressing Enter after each selection until B4A
ends with "EventName" highlighted. This is where you would type in
the name of the Sub.
editBox = string      editBox.Text = string
In VB6, you can leave ".Text" off the names of controls when assigning
text to them, but this is not allowed in B4A.

Dim/ReDim:
---------
Dim Array(n)        Dim Array(n+1)
While "n" is the last index number in VB6, it indicates the number
of array elements when used in B4A. For example, to Dim an array
with 0-32 elements in VB6, you would say Dim A(32), while to convert
this to B4A, you need to change it to Dim A(33), yet index #33 is
never used (doing so would cause an out-of-range error).
ReDim Preserve      Use a List.
ReDim Array()       Dim Array(n+1) -- to clear an array, just Dim it again.
[Dim a Int: Dim b as Boolean]
If Not b Then...    If Not(b) Then...
If b Then...        same
If b = True Then    same
If a Then...        If a > 0 Then...
                       B4A does not treat any non-zero value as True like VB6.
a = a + b           If b = True Then a = a - 1
                       Boolean's value cannot be used in a math function in B4A.
Global Const x=1    B4A does not have a Global Const function.
                       In Sub Globals, you can say   Dim x as Int: x = 1
                       but x is not a constant (it's value can be changed).

Loops, If-Then, Select Case:
---------------------------
Do [Until/While]    same
Loop [Until/While]  Loop  [Until/While not allowed.]
For - Next          same
For i... - Next i   The loop variable (i) is not allowed with Next.
Exit Do/For         Exit
If - Then - Else    same, except VB's ElseIf is "Else If" in B4A; ditto EndIf
   ---              Continue [Skips to Next in For-Next loop]
For i = 1 to 6        For i = 1 to 6
  If i <> 4 Then        If i = 4 Then Continue
    ...code...          ...code...
  End If                ...
Next                  Next
Select Case [expr]  Select [value]

Colors:
------
L1.BackColor =      L1.Color = Colors.Red
    vbRed
L1.ForeColor =      L1.TextColor = Colors.Black
    vbBlack

Calling a sub:
-------------
SubName x, y        SubName(x, y)
Sub SubName()       Sub SubName() As Int/String/etc. -- a Global variable cannot be
                       a parameter, so say that "player" is a Global variable, you
                       cannot say: PlayCard(player). Instead you have to say:
                       i=player: PlayCard(i)
Function FName()    Sub FName() As [var.type]
   As [var.type]       In B4A, any Sub can be used like a Function by adding a
                       variable type such as
                          Sub CheckX(x As Int) As Boolean
                             ...optional code...
                             If x = [desired value] Then Return True
                             ...optional code...
                          End Sub
                       If no Return is given, then zero/False/"" is returned.
                       The calling code does not have to reference the returned
                       value, so that while "If CheckX(x) = True..." is valid,
                       so is just "CheckX(x)"
Exit Sub            Return
Exit Function       Return [value]

General:
-------
CInt
DoEvents            same, except that Erel says:
                    "Calling DoEvents in a loop consumes a lot of resources and
                    it doesn't allow the system to process all waiting messages
                    properly." This was in response to my pointing out that while
                    in a Do Loop with DoEvents in it, WebView could not be loaded
                    or if loaded, would not process a hyperlink click. And Agraham
                    says: "Looping is bad practice on mobile devices. The CPU will
                    be constantly executing code and using battery power as the
                    code will never get back to the OS idle loop where the hardware
                    power saving measures are invoked."
Format()            NumberFormat & NumberFormat2 [see documentation]
InputBox($)         InputList(Items as List, Title, CheckedItem as Int) as Int
can list multiple       Shows list of choices with radio buttons. Returns index.
choices for which       CheckedItem is the default.
the user enters a   InputMultiList(Items as List, Title) As List
number to choose.       User can select multiple items via checkboxes.
                        Returns list with the indexes of boxes checked.
MsgBox "text"       MsgBox("text", "title")
i=MsgBox()          MsgBox2(Message, Title, Positive, Cancel, Negative, Icon) as Int
                        Displays three buttons with text to display for buttons
                           (Positive, Cancel, Negative)
                        Icon is displayed near the title and is specified like:
                           LoadBitmap(File.DirAssets, "[filename].gif")
   ---              ToastMessageShow(text, b) [where b=True for long duration]
Following is a Sub from Pfriemler which acts like InputBox:
Sub InputBox(Prompt As String, Title As String, Default As String, Hint As String) As String
    Dim Id As InputDialog
    Id.Hint = Hint
    Id.Input = Default
    ret = Id.Show(Prompt, Title, "OK", "","Abbrechen", Null)
    If ret = -1 Then Return Id.Input Else Return ""
End Sub

Rnd is < 1          Rnd(min, max) is integer >= min to < max
Rnd(-#)             RndSeed(#) - causes Rnd to generate the same random number series
                                 for the same # entered.
Randomize           Not needed in B4A to randomize Rnd.
Round(n)            same, or Round2(n, x) where x=number of decimal places

i = Val(string)     If IsNumber(string) Then i = string Else i = 0 --
                    An attempt to use i=string "throws an exception" if the string is
                    not numbers, even if the string starts with numbers. For example,
                    t = "10:45"
                    i = Val(t) sets i=10 but causes an error in B4A.
                    Instead,
                    i = t.SubString2(0, 2) = 10
control.SetFocus    view.RequestFocus
n / 0 : error       n / 0 = 2147483647 -- B4A does not "throw an exception" for
                       division by 0, but it does return 2147483647 no matter
                       what the value of "n" is.
x = Shell("...")    See "Intent". This is not a complete replacement, but allows
                       code such as the following from the B4A forum (by Erel):
                    Dim pi As PhoneIntents
                    StartActivity (pi.OpenBrowser("file:///sdcard/yourfile.html"))
t = Timer           t = DateTime.Now ' Ticks are number of milliseconds since 1-1-70

TabIndex:
--------
In VB6, TabIndex can be set to control the order in which controls get focus
when Tab is pressed. According to Erel, in B4A:
   "Android handles the sequence according to their position. You can set
    EditText.ForceDone = True in all your EditTexts. Then catch the
    EditText_EnterPressed event and explicitly set the focus to the next
    view (with EditText.RequestFocus)."

Setting Label Transparency:
--------------------------
Properties - Back Style        Designer - Drawable - Alpha

Constants:
---------
""                  Quote = Chr$(34)
vbCr                CRLF = Chr$(10)
vbCrLf              none

String "Members":
----------------
VB6 uses a character position pointer starting with 1.
B4A uses a character Index pointer starting with 0.
        VB6                        B4A
Mid$("abcde", 1, 1) = "a" = letter array index 0 -- "a" = "abcde".CharAt(0)
Mid$("abcde", 2, 1) = "b" = letter array index 1
Mid$("abcde", 3, 1) = "c" = letter array index 2
Mid$("abcde", 4, 1) = "d" = letter array index 3
Mid$("abcde", 5, 1) = "e" = letter array index 4
     VB6                               B4A
     ===                               ===
Mid$(text, n, 1)                    text.CharAt(n-1)
Mid$(text, n)                       text.SubString(n-1)
Mid$(text, n, x) [x=length wanted]  text.SubString2(n-1, n+x-1) [n+x-1=end position]
Mid$(text, n, x) = text2            text = text.SubString2(0, n-2) & _
                                           text2.SubString2(0, x-1) & _
                                           text.SubString(n-1 + z)  where...
                                             z = Min(x, text2.length)
Left$(text, n)  [n=num.of chars.]   text.SubString2(0, n)
Right$(text, n)                     text.SubString(text.Length - n + 1)
If a$ = b$...                       If a.CompareTo(b)...
If Right$(text, n) = text2...       If text.EndsWith(text2)...
If Left$(text, n) = text2...        If text.StartsWith(text2)...
If Lcase$(text) = Lcase$(text2)...  If text.EqualsIgnoreCase(text2)...
Following are some subs from NeoTechni which take the place of VB6
string functions:
Sub Left(Text As String, Length As Long)As String
   If length>text.Length Then length=text.Length
   Return text.SubString2(0, length)
End Sub
Sub Right(Text As String, Length As Long) As String
   If length>text.Length Then length=text.Length
   Return text.SubString(text.Length-length)
End Sub
Sub Mid(Text As String, Start As Int, Length As Int) As String
   Return text.SubString2(start-1,start+length-1)
End Sub
Sub Split(Text As String, Delimiter As String) As String()
   Return Regex.Split(delimter,text)
End Sub

x = Len(text)                       x = text.Length
text = Replace(text, str, str2)     text.Replace(str, str2)
Lcase(text)                         text.ToLowerCase
Ucase(text)                         text.ToUpperCase
Trim(text)                          text.Trim
  (no LTrim or RTrim in B4A)
Instr(text, string)                 text.IndexOf(string)
Instr(int, text, string)            text.IndexOf2(string, int)
                                       Returns -1 if not found.
                                       Returns char. index, not position.
                                       Starts search at "int".
InStrRev(text, str, start, case)    text.LastIndexOf(string)
  Searches from end of string,      text.LastIndexOf(string, start)
    optionally from "start".           Cannot specify case sensitivity.
  case = 0 = case-sensitive
  case = 0 = case-insensitive
                                    A boolean form of IndexOf is -
                                    If text.Contains(string) = True Then...
If Lcase$(x) = Lcase$(y)...         If x.EqualsIgnoreCase(y)...
text = Left$(text, n) & s &         text.Insert(n, s)
          Right$(Text, y)
Asc(s) [where s = a character]      same

Error Trapping:
--------------
VB6:
===
Sub SomeSub
   On [Local] Error GoTo ErrorTrap
      ...some code...
   On Error GoTo 0 [optional end to error trapping]
   ...optional additional code...
   Exit Sub [to avoid executing ErrorTrap code]
ErrorTrap:
   ...optional code for error correction...
   Resume [optional: "Resume Next" or "Resume [line label]".
End Sub
B4A:
===
Sub SomeSub
   Try
      ...some code...
   Catch [only executes if error above]
      Log(LastException) [optional]
      ...optional code for error correction...
   End Try
   ...optional additional code...
End Sub
WIth B4A, if you get an error caught in the middle of a large subroutine, you can
NOT make a correction and resume within the code you were executing. Only the code
in "Catch" gets executed, plus any code following "End Try".
Try-Catch in place of GoTo:
--------------------------
Try-Catch can be used as a substitute for GoTo [line label] for forward, but not
backward, jumps. It cannot be used to replace GoSub, for which B4A has no equivalent.
Start the code with "Try" and replace the [line label] with "Catch".
Replace "GoTo [line label]" with code which will create an exception, which causes
a jump to "Catch", such as OpenInput("bad path", "bad filename").

"Immediate Window" vs "Logs" Tab
--------------------------------
Comments, variable values, etc., can be displayed in VB6's Immediate
Window by entering into the code "Debug.Print ...".
In the B4A environment, the Logs tab on the right side of the IDE is a
way to show the values of variables, etc., while the code is running.
Both VB6 and (now) B4A allow single-stepping through the code while it
is running and viewing the values of variables. VB6 also allows changing
the value of variables, changing the code, jumping to other lines from
the current line, etc. Because B4A runs on a PC while the app runs on
a separate device, B4A is currently unable to duplicate all of these
VB6 debug features.
GRACIAS POR LEER!!!
« última modificación: Noviembre 01, 2011, 02:23:22 pm por 79137913 »
"Como no se puede igualar a Dios, ya he decidido que hacer, ¡SUPERARLO!"
"La peor de las ignorancias es no saber corregirlas"

 79137913                          *Shadow Scouts Team*                                                          Resumenes Cs.Economicas

raul338

  • Terabyte
  • *****
  • Mensajes: 894
  • Reputación: +62/-8
  • xD fan!!!!! xD
    • Ver Perfil
    • Raul's Weblog
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #1 en: Octubre 31, 2011, 06:24:35 pm »
Ya iba proponer yo hacer un interprete de vb en java :P

fx700

  • Kilobyte
  • **
  • Mensajes: 95
  • Reputación: +4/-2
    • Ver Perfil
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #2 en: Noviembre 01, 2011, 01:48:18 am »
 ;D Voy a probar, ojala que pueda correr el programa :o,

YAcosta

  • Moderador Global
  • Exabyte
  • *****
  • Mensajes: 2853
  • Reputación: +160/-38
  • Daddy de Qüentas y QüeryFull
    • Ver Perfil
    • Personal
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #3 en: Noviembre 01, 2011, 03:12:51 am »
Hola 79137913, tal como se pinta se ve bueno, se agradece.
Yo no sabría probarlo porque recién estoy empezando, pero me gustaría si sebas le diera una mirada a ver que opina. Saludos

« última modificación: Noviembre 01, 2011, 04:56:20 am por YAcosta »
Me encuentras en YAcosta.com

seba123neo

  • Moderador
  • Terabyte
  • *****
  • Mensajes: 763
  • Reputación: +88/-5
    • Ver Perfil
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #4 en: Noviembre 01, 2011, 10:19:05 am »
esta muy bueno, tambien esta MonoDroid para programar en .NET

MonoDroid

para hacer aplicaciones sirve, no hay dudas.

las unicas contras que veo:

es que son pagas (obvio son app de terceros) y como esto es android-linux y es todo libre...

no se hasta que punto soportara las funciones de la api de Android que para colmo se van actualizando cada ves mas rapido.

y la documentacion, para Java encontras miles de paginas y te cansas de encontrar ejemplos y libros de 1000 paginas para programar, no se que tan documentado este esto, me imagino que tiene su documentacion, pero no creo que este tan regado en internet.

yo me voy siempre para lo oficial, que este caso es Eclipse +Java, al principio cuesta pero despues te acostumbras.

saludos.

79137913

  • Megabyte
  • ***
  • Mensajes: 185
  • Reputación: +21/-4
  • 4 Esquinas
    • Ver Perfil
    • Eco.Resumen Resumenes Cs. Economicas
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #5 en: Noviembre 01, 2011, 02:35:21 pm »
HOLA!!!

Añadi la tabla de migracion de VB6 a B4A.

Tengo que decir que lo estuve probando y anda muy bien, les dejo unas aplicaciones que vi por la web hechas con ese interprete // compilador ¿?

http://www.basic4ppc.com/forum/basic4android-share-your-creations/

GRACIAS POR LEER!!!
"Como no se puede igualar a Dios, ya he decidido que hacer, ¡SUPERARLO!"
"La peor de las ignorancias es no saber corregirlas"

 79137913                          *Shadow Scouts Team*                                                          Resumenes Cs.Economicas

fx700

  • Kilobyte
  • **
  • Mensajes: 95
  • Reputación: +4/-2
    • Ver Perfil
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #6 en: Diciembre 14, 2011, 07:53:07 pm »
Tengo que decir que se demora una eternidad en cargar el AVD(Emulador android) cuales son los requisitos de hardware minimos.
Por fin me corrio el AVD y pude ejecutar el "HOLA MUNDO", ahora intente cargar aplicaciones y como utilizo el B4A trial no me deja, pueden subir la version full del B4A.

Saludos

79137913

  • Megabyte
  • ***
  • Mensajes: 185
  • Reputación: +21/-4
  • 4 Esquinas
    • Ver Perfil
    • Eco.Resumen Resumenes Cs. Economicas
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #7 en: Diciembre 15, 2011, 08:23:39 am »
HOLA!!!

Yo tengo una copia trucha, la conseguis con google, no se si el foro permite estas cosas por ende no puse el link para bajarlo trucho.

GRACIAS POR LEER!!!
"Como no se puede igualar a Dios, ya he decidido que hacer, ¡SUPERARLO!"
"La peor de las ignorancias es no saber corregirlas"

 79137913                          *Shadow Scouts Team*                                                          Resumenes Cs.Economicas

MILENIUM_AR

  • Bit
  • Mensajes: 1
  • Reputación: +0/-0
    • Ver Perfil
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #8 en: Mayo 15, 2013, 05:58:08 pm »
Hola gente. Necesito conseguir  DBUtils para basic4android. Como lo "encontre de casualidad" en google, y no estoy registrado, no puedo bajarlo deade la web oficial. Alguiwen podria decirme donde lo puedo conseguir? Abrazo

Bazooka

  • Terabyte
  • *****
  • Mensajes: 951
  • Reputación: +31/-20
  • El pibe Bazooka
    • Ver Perfil
    • Desof sistemas
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #9 en: Junio 15, 2013, 03:31:47 pm »
Hola amigos con buen agrado veo que este foro esta reviviendo un poco y al menos en este área que me ha mantenido un tiempo ocupado.
Quería compartir con uds mi primera aplicación Gratuita echa integramente en Basic4Android y colgada recientemente en Google Play.
Nos les servirá de mucho a UDs por que es algo preparado para mi localidad pero al menos para que vayan mamando un poco de este para mi lindo y sencillo modo de programa para Android

https://play.google.com/store/apps/details?id=guia.digital.sc&feature=search_result#?t=W251bGwsMSwxLDEsImd1aWEuZGlnaXRhbC5zYyJd

De paso ya que están me dejan algún voto o comentario..
Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las mismas cosas.

Bazooka

  • Terabyte
  • *****
  • Mensajes: 951
  • Reputación: +31/-20
  • El pibe Bazooka
    • Ver Perfil
    • Desof sistemas
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #10 en: Junio 15, 2013, 03:58:47 pm »
Hola gente. Necesito conseguir  DBUtils para basic4android. Como lo "encontre de casualidad" en google, y no estoy registrado, no puedo bajarlo deade la web oficial. Alguiwen podria decirme donde lo puedo conseguir? Abrazo

http://leandroascierto.com/foro/index.php?topic=69.0

En este mismo lugar esta lo que buscas en la seccion utilidades!
« última modificación: Junio 17, 2013, 10:09:48 am por Bazooka »
Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las mismas cosas.

Pox1

  • Bytes
  • *
  • Mensajes: 13
  • Reputación: +1/-2
    • Ver Perfil
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #11 en: Noviembre 03, 2016, 08:01:57 pm »
Hola, buen día

Disculpen por reabrir un post de años, y por mis desconocimiento en el tema, pero mi consulta es en base a este post...; me descargue el JAVA SDK, ANDROID SDK y B4A Trial según lo requerido por79137913...

Lo que he entendido es que con esos programas puedo crear una aplicación para celulares movil con android osea crear una app? se que hay muchas opciones por ahí, pero quiero empezar por lo mas familiar.
Vi un par de videos en la web e intente hacer la calculadora q esta por ahí, pero al momento de dar f5, me manda este error:



Que es WSAPoll? pq ese error??

Usando el B4A podría hacer un app para uso personal, digamos q si tengo un excel con 100 mil items, cada columna tiene una descripción, y lo que pensaba hacer es jalar la info del excel a la app, escribir en una caja de texto de la app digitamos el SKU y presionamos enter y se llenen las demás cajas de texto con los datos restantes de las columnas del excel?? ojalá haberme explicado correctamente.

Gracias

Slds,
"Del infierno al cielo"

dekapit

  • Bit
  • Mensajes: 1
  • Reputación: +0/-0
    • Ver Perfil
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #12 en: Noviembre 17, 2016, 05:49:16 pm »
hola.
ese error  es por el driver adb, puede ser que estes pasando la app directamente al celular desde un usb, s deberia solucionar reinstalando los driver adb universal o eldriver de tu celular.

Luffy

  • Kilobyte
  • **
  • Mensajes: 90
  • Reputación: +4/-2
  • Desarrollar es el arte de crecer no de crear.
    • Ver Perfil
Re:Basic4Android Programen en BASIC sus programas Android
« Respuesta #13 en: Junio 07, 2017, 05:04:00 am »
Basic4Android es una muy buena herramienta, pero debes tener dos conocimientos fundamentales para poder utilizarla

1. BASIC
2. ANDROID

Suena muy lógico y hasta absurdo ya que en su nombre lo dice, pero mucha gente quiere introducirse con esta herramienta cuando en si sirve para lo contrario, a mi criterio es para programadores experimentados que ya manejan Java, C# y conocen el entorno de ANDROID y que además les gusta mucho más BASIC

Si quieres hacer algo funcional con esta herramienta antes debes aprender todas las librerías y bibliotecas que tiene ANDROID y para que sirven, a lo que quiero decir: el aprendizaje para dominar ANDROID no es intuitivo con Basic4Android pero si con Java o c# por ejemplo.

Enviado desde mi MYA-L23 mediante Tapatalk