Problem with phoneID, after compile device.exe

schimanski

Well-Known Member
Licensed User
Longtime User
Hello and :sign0085:

My application checks the IMEI as software-protection with the phoneID.dll. It runs on every device, I have tested it. Now I tried to start it on the Eten Glofiish X650 after compiling and get an error in line phone.setstrings="" of the following sample-code. The error only exists after compiling it to device.exe and also to autoscale. It only runs under basic4ppc...:BangHead:

I have ordered some eten x650 for my friends, but now the main-app doesn't run:sign0148:

B4X:
Sub App_Start
...
  phone.New1
  phone.setstrings=""
....
End Sub

Sub Button_Click
...
  label1.Text=phone.imei
...
End Sub
 

schimanski

Well-Known Member
Licensed User
Longtime User
Helo Erel!

This is the error-message:

An error occurred on sub _app_start.

Specified argument was out of the range of valid values.

I got the error-message only after install 'NETCFv35.Messages.EN.cab'.

An isolation of the code shows, that the error is in line phone.setstrings="".

Thanks for help...
 

schimanski

Well-Known Member
Licensed User
Longtime User
Hello agraham, thanks for answer!

I know, that the phone must be on to work with the phoneID. But I have tested more and I compiled the code with basic4ppc Version 6.5 and it runs perfectly.
That's also the reason, that some peoples told me, that the new version doesn't run. Only the old versions runs, which are compiled with 6.5. The code of the IMEI-Check is always the same.... The compile under windows 6.5 is optimized for QVGA and VGA.

In the meantime, the code doesn't runs on some htc touch diamond 1...:sign0085:
 

agraham

Expert
Licensed User
Longtime User
As the library is precompiled, without source for merging, I can think of no reason why it might be OK under 6.5 and not later :confused:

The PhoneID demo works fine on my HTC Diamond 1 when compiled under 6.86. Have you tried just that demo, optimised compiled, on a failing phone? Does your code run in the device IDE on a failing phone?

I'm afraid that without actually having code that fails I can't suggest anything else.
 

schimanski

Well-Known Member
Licensed User
Longtime User
hello agraham,

I have compiled the short demo above with 6.5 and 6 .8 and on some devices it only runs under 6.5. Under the device IDE, it also runs without problems on all devices..:confused:
 

schimanski

Well-Known Member
Licensed User
Longtime User
Thanks agraham!

I have tested the following code from the db2000 GetInfoDevice.dll also on a failing phone, perhaps it is usefull to locate the problem:

B4X:
Sub Globals
   Dim xInfo(6)   
End Sub

Sub App_Start
   GetDevice.New1
   xInfo() = GetDevice.info
   TextBox1.Text = xInfo(4)
   Form1.Show
End Sub

It runs on a failing phone under the 6.8 device IDE and under optimized compiling with the version 6.5. It doesn't runs under optimized compiling with 6.8...

And here the .exe-files under optimized compiling 6.5 and 6.8:
 

agraham

Expert
Licensed User
Longtime User
Try this library and see if it also fails. There is source for merging in the archive so you can try it both with just the separate dll and with merged source. It doesn't need Tapi.dll so to be sure please delete Tapi.dll from the project folder when you try it.

If it does fail then please post the compiled exes and I'll take a further look although to be honest I can't think what I could do different.
 

Attachments

  • PhoneInfo1.0.zip
    5.5 KB · Views: 216

schimanski

Well-Known Member
Licensed User
Longtime User
The same problem....:confused:
 

Attachments

  • PhoneInfo1.zip
    19.1 KB · Views: 203
  • PhoneInfo1.0 6_5.zip
    18.3 KB · Views: 187

agraham

Expert
Licensed User
Longtime User
I can see no real difference in the generated code for the two versions. It's got to be something to do with the way the programs are being run.

Under 6.5 the program is run using a small exe as a runner program that makes the device think the application is a .NET 1.0 program so it gets autosized by the Compact Framework when run on a VGA device.

Under 6.8 the program is compiled as a .NET 2.0 application, which the CF does not automatically scale, and does the AutoScaling itself.

Both versions work fine on my HTC Diamond P3700, which is the only device with a phone that I have. I am afraid that I have no idea why it works on some phones and not others.
 

schimanski

Well-Known Member
Licensed User
Longtime User
Hello agraham!

Thanks for your effort..

The msgbox shows 'Manufacturer'.....

(I have just seen, that the b4ppc device IDE shows me, that .Net Version 3.5.7283 under WM6.1 is installed. Could that be the reason? I have installed .Net Compact Framework 2.0, but the same problems and under the device IDE it is after the install still the version 3.5.7283.)
 

schimanski

Well-Known Member
Licensed User
Longtime User
Hello agraham!

The stage is 'Manufacturer, 180, 0, 0, -1'
The error is 'Specified argument was out of the range of valid values.'

The stack is
bei
System.String.Substring(Int32 startIndex, Int32 lenght)
bei
PhoneInfo.PhoneInfo.GetInfo()
bei
Dbasic.b4p._main_getinfo()
bei
Dbasic.b4p._main_app_start()
bei
Dbasic.b4p..ctor(String[]args)
bei
Dbasic.b4p.Main(String[]args)

I have also checked this:

When I run the phoneID-app under the device IDE with the 'Basic4ppc.exe', the programm runs correct. When I start the device IDE with the file 'Basic4ppc-VGA.exe', I get the same errormessage as I have compiled the code:

An error occurred on sub _app_start.
Specified argument was out of the range of valid values.

The failing phone is WM6.1 with VGA-Screen.....
 

agraham

Expert
Licensed User
Longtime User
When I run the phoneID-app under the device IDE with the 'Basic4ppc.exe', the programm runs correct. When I start the device IDE with the file 'Basic4ppc-VGA.exe', I get the same errormessage as I have compiled the code
That does tally with the behaviour when it is running compiled under 6.5 or 6.8. I believe that Basic4ppc.exe is running as a .NET 1.0 app so it is scaled by the CF when on a VGA device and Basic4ppc-VGA.exe is pure .NET 2.0 app.

It looks from the error that a native code call is returning different values depending upon the .NET environment the application is runnning under. I am totally baffled at the moment. Try this version, don't bother with posting the stacktrace, but post the stage message with the numbers.
 

Attachments

  • PhoneInfo1.3.zip
    4.3 KB · Views: 190
Last edited:

agraham

Expert
Licensed User
Longtime User
For some unknown reason the native call is not returning a manufacturer nor a model string under the failing condition.

Try this version. Hopefully it will work on the failing phone. Compare the information it displays with the same phone when under failing and working conditions. This version may also return the IMEI even if the phone is off, at least it does on my Diamond.

As I think this may work I have taken out all the debug code and included the source for merging in the archive.
 

Attachments

  • PhoneInfo1.4.zip
    5.6 KB · Views: 200

schimanski

Well-Known Member
Licensed User
Longtime User
Yes!!!!! that it is...:sign0060::sign0060:

I have tested it on a normal and a failing phone and it always shows me the IMEI. The only difference is, that on a failing phone there is no information about Manufacturer and Model, but I only need the IMEI....


:icon_clap::icon_clap::icon_clap: Respect, agraham!

Many thanks for your big efforts....
 
Top