Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4android > Basic4android Updates and Questions
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Basic4android Updates and Questions Updates and questions regarding Basic4android.

Get PhoneId.GetDeviceId from server

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-04-2012, 01:10 PM
Junior Member
 
Join Date: Jan 2012
Posts: 44
Default Get PhoneId.GetDeviceId from server

Hi do anyone know how I fix his Please , Thanks

I am try to get textfile with same name and DeviceId and save it to my mobile
it save the name on my mobile = & PhoneId.GetDeviceId & .txt
not like = 000000000000000.txt

Regards
Sigster

This is in button in LoadLayout("getfile")
Code:
    DownloadService.URL = "http://URL/" & PhoneId.GetDeviceId  & ".txt"

DownloadService.Target = 
File.OpenOutput(File.DirDefaultExternal,"& PhoneId.GetDeviceId  & .txt"False)
StartService(DownloadService)
this is when form start to check if I have the file or not
Code:

    
If File.Exists(File.DirDefaultExternal,"& PhoneId.GetDeviceId  & .txt"Then
    
        
ToastMessageShow("the file is on your Mobile"True)
    
            
Else
            
ToastMessageShow("No file"True)
                                 
        RemoveViews
        Activity.LoadLayout(
"getfile")    
        
    
End If
Reply With Quote
  #2 (permalink)  
Old 02-04-2012, 02:00 PM
Junior Member
 
Join Date: Jun 2011
Posts: 21
Default

Quote:
Originally Posted by sigster View Post
Hi do anyone know how I fix his Please , Thanks

I am try to get textfile with same name and DeviceId and save it to my mobile
it save the name on my mobile = & PhoneId.GetDeviceId & .txt
not like = 000000000000000.txt

Regards
Sigster

This is in button in LoadLayout("getfile")
Code:
    DownloadService.URL = "http://URL/" & PhoneId.GetDeviceId  & ".txt"

DownloadService.Target = 
File.OpenOutput(File.DirDefaultExternal,"& PhoneId.GetDeviceId  & .txt"False)
StartService(DownloadService)
this is when form start to check if I have the file or not
Code:

    
If File.Exists(File.DirDefaultExternal,"& PhoneId.GetDeviceId  & .txt"Then
    
        
ToastMessageShow("the file is on your Mobile"True)
    
            
Else
            
ToastMessageShow("No file"True)
                                 
        RemoveViews
        Activity.LoadLayout(
"getfile")    
        
    
End If
Hi,

it think you should fix your code like this :

Code:
DownloadService.Target = File.OpenOutput(File.DirDefaultExternal, PhoneId.GetDeviceId & ".txt"False)
Code:
If File.Exists(File.DirDefaultExternal,PhoneId.GetDeviceId & ".txt")
or

Code:
DownloadService.Target = File.OpenOutput(File.DirDefaultExternal, "PhoneId.GetDeviceId.txt"False)
__________________
ASUS Eee Pad Transformer TF101 16GB :: Ice Cream Sandwich 4.0.3

Last edited by Ohanian : 02-04-2012 at 02:04 PM.
Reply With Quote
  #3 (permalink)  
Old 02-04-2012, 06:08 PM
Junior Member
 
Join Date: Jan 2012
Posts: 44
Default

This works thanks

I call PhoneId.GetDeviceId in DownloadService.URL and DownloadService.Target
so if the file is not on the server DownloadService.Target make a new one

there is no check if the file "PhoneId.GetDeviceId" is on the server and then download it

Regards
Sigster
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PhoneId returns wrong phone number Cdymock Basic4android Updates and Questions 1 01-30-2012 04:09 AM
Is GetDeviceId really Uniq? vb1992 Basic4android Updates and Questions 2 11-04-2011 06:17 PM
GetDeviceID null fargoz Basic4android Updates and Questions 1 05-18-2011 06:19 AM
GetDeviceID not work micro Questions (Windows Mobile) 3 05-18-2010 03:49 PM
Problem with phoneID, after compile device.exe schimanski Questions (Windows Mobile) 19 03-28-2010 02:42 PM


All times are GMT. The time now is 10:49 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0