PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → WM15 - AndroidManifest.xml
WM15 - AndroidManifest.xml
Iniciado por Georgio, jul., 20 2010 9:01 PM - 9 respostas
Publicado em julho, 20 2010 - 9:01 PM
Hi All,
I'm trying to create a SurfaceView object in WM15 but I don't think that any of
Windev's controls resolve to this object type so I'm coding it in Java.
However, I can't use the object unless, of course, I declare the tag in the Android
Manifest file ...
Has anyone figured out how to do this within the IDE? I've found a way to do it
manually (after the APK generation) but I lose the tag once I regenerate.
Thanks!
Georgio
Publicado em julho, 21 2010 - 11:31 AM
Hi Georgio!
This is not possible :( (got already an answer from PCSoft-Support).
Best regards
Andreas
Publicado em julho, 22 2010 - 9:41 AM
Hi Georgio!

>

This is not possible :( (got already an answer from PCSoft-Support).


>

Best regards


>Andreas

Thanks Andreas,
If anyone is interested in how to do this upon compilation, let me know.
Georgio
Publicado em julho, 23 2010 - 11:10 AM
Hi Georgio!
I'm interested :). I have developed an APP which needs to be configured to use allways Landscape Mode and they only way to do that is by adding that into the manifest.
Many thanks.
Best regards
Andreas
Publicado em agosto, 06 2010 - 12:55 PM
Hi Georgio,


>If anyone is interested in how to do this upon compilation, let me know.


I could'nt contact you via your homepage because there are some problems with the contact-form. Could you please send me your contact information to adolleschal[at]gmail.com?
Many thanks.
Best regards
Andreas
Publicado em agosto, 09 2010 - 11:35 PM
Hi Andreas,
I didn't see this sooner. I'll post it here as I think it could benefit anyone.
1. In windows explorer, go to your project.
2. Switch to the "android" directory within the project.
(Keep it open, you have to do some quick work.)
3. In windev, generate the project.
4. QUICKLY, switch back to the explorer window. You will notice
a new directory called "Generation". Switch into that directory.
5. Copy and paste the AndroidManifest.XML to your desktop.

Even though we created a new APK with the new generation,
we will not be using it.
6. Open the AndroidManifest.XML file on your desktop (with notepad or
any XML editor)
7. Find the tag and place the screen orientation within it. It should
look like this:
<activity android:name=".wdgen.GWDPDPLS$WDLanceur"
android:label="@string/app_name" android:theme="@android:style/Theme.Translucent"
[color=#FF0000]android:screenOrientation="landscape"[/color]>
(add the text in red to the XML string)
8. Save it. (forever! - The AndroidManifest is destroyed with every new generation.)
And copy (to paste)
9. Regenerate the Windev project. (Make sure you have the "android" directory
open in windows explorer).
10. Paste the AndroidManifest.XML file into the Android directory approx. 2 seconds
after the new generation.
Viola, landscape only.
Any questions, my contact page is back up.
Thanks!
Georgio
Publicado em setembro, 08 2010 - 11:59 PM
Hi!
If you do not want to fiddle around with manifest.xml you can use the following code:
import android.app.Activity;
import android.content.pm.ActivityInfo;
PUBLIC static void setOrientationPortrait()
{
Activity myActivity = getCurrentActivity();

myActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}

Best regards
Andreas
Publicado em setembro, 09 2010 - 11:49 PM
Hi Andreas,
Any configuration change to an Android activity could force it to restart itself. Besides the UI, this tends to be the most expensive part of an application.
More than 1 way to skin a cat tho' :rp:
Thanks
Georgio
Publicado em setembro, 10 2010 - 11:49 AM
>Any configuration change to an Android activity could force it to restart itself. Besides the UI, this tends to be the most expensive part of an application.


Thanks for this remark! I do that before any other things in my Application-Windows (Global Declaration).
Best regards
Andreas
Membro registado
164 mensagems
Popularité : +10 (10 votes)
Publicado em setembro, 23 2020 - 5:06 PM
Je pense que la solution est dans ce sujet sur StackOverflow, mais pour l'adaptation en Windev Mobile ça reste à voir :
https://stackoverflow.com/questions/58379543/cant-create-directory-in-android-10