|
Importation de class Java dans le projet Mobile |
Started by Gemini1961, Jul., 30 2020 2:10 PM - 7 replies |
| |
| | | |
|
| |
Posted on July, 30 2020 - 2:10 PM |
Bonjour à toutes et tous
Après avoir parcouru l'aide en ligne, je n'ai pas trouvé la façon d'intégrer des class écrites en Java dans un projet WD Mobile 24
Une personne connait-elle la marche à suivre ?
Merci pour votre aide
Bien cordialement |
| |
| |
| | | |
|
| | |
| |
Registered member 22 messages |
|
Posted on July, 30 2020 - 4:26 PM |
Bonjour, on ne peut intégrer directement des classes. Il faut d'abord la transformer en .jar ou .aar.
Il est possible également de créer une fonction en java, il suffit de créer un procédure windev, puis dans le cade de la procédure, cliquer sur le cadre "WL" qui se trouve tout en haut à coté du texte "Procédure globale nomDeLaProcedure" et choisir java. |
| |
| |
| | | |
|
| | |
| |
Registered member 286 messages Popularité : +24 (28 votes) |
|
Posted on July, 30 2020 - 6:13 PM |
Bonsoir Clément
Merci pour ta réponse
J'ai effectivement créer des librairies .jar et j'ai essayé de les joindre aux projets via listes des éléments du projet
mais impossible d'appeler la moindre méthode de ces librairies via une procédure ( en code java donc pas de WL ... ) cela génère une erreur
J'avoue que je suis un peu perdu, cela me semblait pourtant si simple ....
Bonne soirée |
| |
| |
| | | |
|
| | |
| |
Registered member 22 messages |
|
Posted on July, 31 2020 - 10:41 AM |
Pour t'aider, il me faudrait l'erreur et le code de ta procédure. |
| |
| |
| | | |
|
| | |
| |
Registered member 12 messages Popularité : +7 (7 votes) |
|
Posted on July, 24 2021 - 4:46 PM |
import android.app.Service; import android.app.NotificationManager; import android.content.Intent; import android.os.Build; import android.os.IBinder; import android.content.Context; import android.app.Activity; import android.os.ResultReceiver;
import android.view.View; import android.widget.Toast;
PUBLIC class myService extends Service {
int startMode; IBinder binder; boolean allowRebind;
@Override PUBLIC void onCreate() { Toast.makeText(this, "onCreate()", Toast.LENGTH_SHORT).show(); appelProcedureWL("WLAndroid_AfficheInfo", "onCreate()"); } @Override PUBLIC int onStartCommand(Intent intent, int flags, int startId) { Toast.makeText(this, "onStartCommand : The service is starting, due to a call to startService()", Toast.LENGTH_SHORT).show(); RETURN startMode; } @Override PUBLIC IBinder onBind(Intent intent) { Toast.makeText(this, "IBinder onBind : A client is binding to the service with bindService()", Toast.LENGTH_SHORT).show(); RETURN binder; } @Override PUBLIC boolean onUnbind(Intent intent) { Toast.makeText(this, "onUnbind : All clients have unbound with unbindService()", Toast.LENGTH_SHORT).show(); RETURN allowRebind; } @Override PUBLIC void onRebind(Intent intent) { Toast.makeText(this, "after onUnbind() has already been called", Toast.LENGTH_SHORT).show(); } @Override PUBLIC void onDestroy() { Toast.makeText(this, "onDestroy() : service done", Toast.LENGTH_SHORT).show(); }
}
PUBLIC static string TAG = "WM SMS"; PUBLIC static string msCallback = "";
PUBLIC static void StartServiceWithJava() { Intent intent = new Intent(getActiviteEnCours(), myService.class);
try { getActiviteEnCours().startService(intent); Toast.makeText(getActiviteEnCours(), "startService()", Toast.LENGTH_SHORT).show();
}catch ( EXCEPTION e ) { appelProcedureWL("WLAndroid_AfficheInfo", e.getMessage()); } finally { }
}
-- ChMoeZ |
| |
| |
| | | |
|
| | |
| |
Posted on October, 28 2022 - 2:08 PM |
Bonjour,
Avez-vous réussi à trouver une solution pour surcharger des méthodes Java ?
Je suis actuellement confronté au même souci dans windev mobile 27.
Merci |
| |
| |
| | | |
|
| | |
| |
Posted on December, 19 2022 - 11:21 PM |
Je peux vous aider pour lintegration |
| |
| |
| | | |
|
| | |
| |
Posted on December, 29 2022 - 1:59 PM |
J'aurais besoin de votre aide pour ajouter des class et les appeler via une procédure. |
| |
| |
| | | |
|
| | | | |
| | |
|