PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → WM 15 Android WiFi Example
WM 15 Android WiFi Example
Iniciado por guest, 08,may. 2010 02:56 - 9 respuestas
Publicado el 08,mayo 2010 - 02:56
Does anyone have this example? ... provided in LST 80
Thanks!
Georgio
Publicado el 08,mayo 2010 - 11:44
Hi Giorgio
1. LST 80 is announced, not out yet
2. it's $$$ and the license doesn't allow to give away its content, so if anybody does give it to you, advertising it here may not be the best idea
but 3. you can order even ONE lst from pcsoft web site
Best regards
Publicado el 09,mayo 2010 - 19:24
If somebody can share his experiments great, because I don't understand French.
When a LST in english?
I'm very interested in know how to attach GPS, WiFi and so on from a WDMobile-Android app.
Publicado el 10,mayo 2010 - 19:57
Thanks Fabrice, I wouldn't mind paying for it ... I could always translate it, so no big deal ...
However ...
Working with the mobile program to create an Android application is challenging to
say the least. There is little to no documentation (at least in English) and this is
making it a learning curve in itself.
I'm trying to access the phone's contacts and for the life of me cannot figure how or where
I can access the android SDK from within the IDE. >
If there isn't a way to do this, then creating an Android app within WM would prove
nearly useless. But, I believe there has to be a way because of this elusive WiFi example
and the fact that when generating the Android application in WM, there is a step that
asks what permissions should be added to the AndroidManifest. Communications
such as Bluetooth, CallCatch, etc. are proposed -- not available within WM.
I've shot a request to tech support. I'll see what they say. For now, I'll keep working
with Eclipse.
Thanks
Publicado el 11,mayo 2010 - 00:58
I tried calling with Global Procedures Java Code like this:
http://developer.android.com/guide/topics/wireless/bluetooth.html
But no success. for the moment, I don't need to "talk" with GPS or Wifi or BT now, but, as you said, if you can't access easily, then, WinDev Mobile for Android, is useless.
Publicado el 11,mayo 2010 - 15:02
Hi Guiseppe,

>

It took me a few hours to find, but I found out how to do this:


>



>

I knew it was possible to enter Java code directly into Windev; I just never chose to.


>

I guess in order to implement Java code, you have to understand how the OS works.


>

How are you entering your bluetooth code? Are you importing the packages required


>from the SDK?



>



>

Edited 1 times. Last edit at 05/10/10 09:32PM by Georgio.

Hi Georgio,
In one application for Android I'm devloping, I'm trying some things as testing.
For example, I created a Global Procedure calle CheckJavaCode, and activate Java mode for it.
The code of this procedure is:
import android.provider.Contacts.People;
import android.content.ContentUris;
import android.net.Uri;
import android.database.Cursor;

public static String CheckJavaCode()
{
// Use the ContentUris method to produce the base URI for the contact with _ID == 23.
//Uri myPerson = ContentUris.withAppendedId(People.CONTENT_URI, 23);

// Alternatively, use the Uri method to produce the base URI.
// It takes a string rather than an integer.
Uri myPerson = Uri.withAppendedPath(People.CONTENT_URI, "23");

// Then query for this specific record:
Cursor cur = managedQuery(myPerson, null, null, null, null);
// Form an array specifying which columns to return.
String[] projection = new String[] {
People._ID,
People._COUNT,
People.NAME,
People.NUMBER
};

// Get the base URI for the People table in the Contacts content provider.
Uri contacts = People.CONTENT_URI;

// Make the query.
Cursor managedCursor = managedQuery(contacts,projection,null,null,People.NAME + " ASC");
String CadenaADevolver;
if (cur.moveToFirst()) {
String name;
String phoneNumber;
int nameColumn = cur.getColumnIndex(People.NAME);
int phoneColumn = cur.getColumnIndex(People.NUMBER);
String imagePath;

do {
// Get the field values
CadenaADevolver += cur.getString(nameColumn) + ";";
CadenaADevolver += cur.getString(phoneColumn) + ";";
} while (cur.moveToNext());
return CadenaADevolver;
}
}
With this result trying to build:
Command Line: C:\Archivos de programa\Java\jdk1.6.0_17\bin\javac.exe -encoding cp1252 -target 1.5 -d bin\classes -bootclasspath "C:\android-sdk-windows\\platforms\android-4\android.jar" -classpath libs\WD150Android.jar gen\com\mycompany\controlyourmoney\*.java src\com\mycompany\controlyourmoney\wdgen\*.java

Error returned:
src\com\mycompany\controlyourmoney\wdgen\GWDCPGlobalProcedures.java:60: cannot find symbol
symbol : method managedQuery(android.net.Uri,,,,)
location: class com.mycompany.controlyourmoney.wdgen.GWDCPGlobalProcedures
Cursor cur = managedQuery(myPerson, null, null, null, null);
^
src\com\mycompany\controlyourmoney\wdgen\GWDCPGlobalProcedures.java:74: cannot find symbol
symbol : method managedQuery(android.net.Uri,java.lang.String[],,,java.lang.String)
location: class com.mycompany.controlyourmoney.wdgen.GWDCPGlobalProcedures
Cursor managedCursor = managedQuery(contacts,projection,null,null,People.NAME + " ASC");
^
2 errors

I builded this code with the information from: http://developer.android.com/guide/topics/providers/content-providers.html
But I tried some time ago, use the WiFi or Bluetooth without success. AFAIR, with same errors.
At the moment, I'm only trying to interact with the Android OS, nothing important. Only tests. But not success.
I'm interested all information about this. I think we need to join everybody to get help to get this working. Because the solution of PCSoft seems to pay for the next LST (or the next WX version), althoug you don't speak french.
Publicado el 12,mayo 2010 - 01:07
Hi Giuseppe,
The compilation error you are receiving is generated from your Java compiler ... not windev.
(usually a class path problem) .. In other words, you are trying to use a class that your
compiler doesn't recognize.
The code you are posting is telling the OS to select contact #23 using a Content Provider
and then give control to the cursor object. A cursor in Android is similar a Java iterator ...
it will allow you to loop through a list. There may be an issue as I think Windev uses its
own "cursor" of sorts to interate lists.
Try this:
1. Import the class: android.widget.CursorAdapter
2. Make sure your ClassPath to the Android SDK is set
Can you repost your results?
Thanks!
Georgio
Miembro registrado
1 mensaje
Publicado el 13,octubre 2010 - 00:55
I cant compile (Seven 32bit, JSE 1.6)
Here is the command executed by WM :

Current Directory :
C:\WinDevMobile15\Exemples\Android\Android Explorer\Android\Generation

Executed Command :
javac.exe -encoding cp1252 -target 1.5 -d bin\classes -bootclasspath "C:\android\\platforms\android-3\android.jar" -classpath libs\WD150Android.jar gen\com\masociete\android_explorer\*.java src\com\masociete\android_explorer\wdgen\*.java

I tried in command line and seems working... except i dont have .apk in bin, only a ".ap_" (which is a .apk but not complete)
Publicado el 29,noviembre 2014 - 19:26
Giuseppe Luigi Punzi a écrit :
I tried calling with Global Procedures Java Code like this:
http://developer.android.com/guide/topics/wireless/bluetooth.html
But no success. for the moment, I don't need to "talk" with GPS or Wifi or BT now, but, as you said, if you can't access easily, then, WinDev Mobile for Android, is useless.