Recent

Author Topic: LAMW: Android 7.1.2  (Read 5841 times)

c4p

  • Full Member
  • ***
  • Posts: 157
LAMW: Android 7.1.2
« on: April 20, 2018, 10:45:21 am »
When writing to storage it does not seem to work on 7.1.2 (crashes out) but works fine on 5.1.1, 4.4 and others (I have permissions set).
Any ideas what could be causing this issue?
I also get the same result with a fresh project, just try a SaveToFile and it will crash.
I have done a complete rebuild of Lazarus+LAMW+SDK+NDK and still get the same result on 7.1.2. AFAIK it was OK on 7.1.1.
Can someone check this to confirm? in case it's my setup?  :'(

Update: Ran my old version on 7.1.2 and it works but not new compiles/builds! I recently upgraded from LAMW 0.7 to 0.8 but not convinced that is the issue.
« Last Edit: April 20, 2018, 05:22:49 pm by c4p »
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: LAMW: Android 7.1.2
« Reply #1 on: April 20, 2018, 07:32:29 pm »

Hi c4p,

Please, post a simple code [test] here....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

c4p

  • Full Member
  • ***
  • Posts: 157
Re: LAMW: Android 7.1.2
« Reply #2 on: April 20, 2018, 11:46:55 pm »
I think I have isolated the issue and should have picked up on it sooner tbh.
Not sure if you recall a while back I mentioned that I could not save to the TEnvDirectory dirInternalAppStorage using the jDownloadManager component but could to dirDownloads, dirNotifications etc., to cut a very long story short, I could save to Internal App Storage on 5.1.1 but not on 7.1.2 and can no longer save data directly to that location, but can save fine on 5.1, 4.4 etc. which sent me on a bit of a tangent.
The code below works perfect on 5.1.1, 4.4.2 but not on 7.1.2:
Code: Pascal  [Select][+][-]
  1. jListView1.Items.SaveToFile(GetEnvironmentDirectoryPath(dirSdCard)+GetInternalAppStoragePath+'/test.txt');
I did fresh installs back to LAMW rev. 691, rev.700 and used the latest rev.701 (0.8 version) but was still the same.

So to summarise, it's not a new issue and is to do with saving to the InternalAppStorage on certain Android versions, one being 7.1.2.
« Last Edit: April 27, 2018, 08:59:16 am by c4p »
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: LAMW: Android 7.1.2
« Reply #3 on: April 21, 2018, 03:56:42 am »
Hi c4p,

jListView1.Items.SaveToFile(''...") is a FPC question...

What about:

 jListView1.Items.SaveToFile('text1.txt')  ???

This should save to Internal app storage... Can you test?

Ok, I will try  implement  a [android]  "jListView1.SaveToFlie" ...

[Edited]

Done!!!  You can try:

 jListView1.SaveToFlie('MyListContent.txt');

and

 jListView1.LoadFromFlie('MyListContent.txt');

« Last Edit: April 21, 2018, 07:37:34 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

c4p

  • Full Member
  • ***
  • Posts: 157
Re: LAMW: Android 7.1.2
« Reply #4 on: April 22, 2018, 12:44:01 am »
Really appreciate you doing this jmpessoa but unfortunately could not get jListview1.SaveToFile working on any API I tried.

Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: LAMW: Android 7.1.2
« Reply #5 on: April 22, 2018, 01:18:22 am »

How Not?

Please, update your LAMW stuff.... [there is not any API issue....]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

c4p

  • Full Member
  • ***
  • Posts: 157
Re: LAMW: Android 7.1.2
« Reply #6 on: April 22, 2018, 11:06:17 am »
Starting to think it may be my device, I am checking it now.
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

c4p

  • Full Member
  • ***
  • Posts: 157
Re: LAMW: Android 7.1.2
« Reply #7 on: April 23, 2018, 12:30:44 am »
Update: I may thought I found the culprit, found a lcl unit in the lps file which may didn't help.

I would love to say I have cracked it, but no.
Still stuck on LAMW rev.691. :o
« Last Edit: April 24, 2018, 07:16:01 pm by c4p »
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: LAMW: Android 7.1.2
« Reply #8 on: September 04, 2018, 07:47:57 am »
Hi c4p!

About "SaveToFile" and others issues...

Now,  LAMW  support  "run time permission"  [Target API >= 23] ...

As code example, you can  see the updated "AppCameraDemo"   and

the new demo "AppHttpClientDemo3" ....
« Last Edit: September 04, 2018, 07:52:14 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

TinyPortal © 2005-2018