SKI Resort Information & Ranking of Korea App built in Delphi XE7 for Android and iOS
Delphi FireMonkey book has been published in Korea
"Android / iOS app developing with Delphi"
Part One Edition published and Part Two Edition coming soon.
The authors are me and Wonkyoung Kim and Hyunsu Kim.
- Internet store link of korea.
http://www.yes24.com/24/goods/15045335?scode=032&OzSrank=2
[kyobobook]
http://www.kyobobook.co.kr/product/detailViewKor.laf?ejkGb=KOR&mallGb=KOR&barcode=9788996251644&orderClick=LAG&Kc=
Calculation of two point distance from location sensor
Calculation of two point distance from location sensor.
Unit of result value is a km.
Unit of result value is a km.
function TForm1.CalcDistance( lon1, lat1, lon2, lat2 : single ) : single; var theta, dist : double; begin theta := lon1 - lon2; dist := sin( degTorad(lat1)) * sin(degTorad(lat2)) + cos(degTorad(lat1)) * cos(degTorad(lat2)) * cos(degTorad(theta)); dist := arccos(dist); dist := radTodeg(dist); dist := dist * 60 * 1.1515; dist := dist * 1.609344; result := dist; end; |
Long Touch event generation method for Delphi XE5~XE7 Firemonkey On Android, iOS, OSX, And Windows
OnMouseClick event is used for Short Touch event in Button or ListBox, etc.
Delphi in FireMonkey do not provide a Long touch event separately.
Android or iOS smart device determines a long Touch time about 0.7 to 1.0 seconds normally .
Thus, Long Touch can be determined by measuring the count timer 0.1 seconds while pressing the button or any other objects.
Button이나 ListBox등에 사용되는 OnMouseClick 이벤트는 터치 단말기에서 숏터치에 사용 된다.
Delphi FireMonkey에서는 별도의 롱터치 이벤트를 제공하지 않는다.
따라서 롱터치 이벤트를 적용하기 위해서는 OnMouseDown 이벤트 싯점에 타이머를 가동하여 일정 시간이 흐른 후 롱터치로 판단하여 처리 할 수 있다.
안드로이드 또는 iOS 스마트 단말기는 보통 0.7~1.0 초 정도의 시간동안 사용자가 버튼을 누르고 있으면 롱터치로 판단한다.
따라서 버튼을 누르고 있는동안 0.1초 간격으로 타이머를 발생시켜 그 횟수를 측정하면 된다.
2. OnMouseUp : Count Timer ~ Short Touch Event
3. OnTimer : Increase Timer Count ~ Long Touch Event
Delphi in FireMonkey do not provide a Long touch event separately.
Android or iOS smart device determines a long Touch time about 0.7 to 1.0 seconds normally .
Thus, Long Touch can be determined by measuring the count timer 0.1 seconds while pressing the button or any other objects.
Button이나 ListBox등에 사용되는 OnMouseClick 이벤트는 터치 단말기에서 숏터치에 사용 된다.
Delphi FireMonkey에서는 별도의 롱터치 이벤트를 제공하지 않는다.
따라서 롱터치 이벤트를 적용하기 위해서는 OnMouseDown 이벤트 싯점에 타이머를 가동하여 일정 시간이 흐른 후 롱터치로 판단하여 처리 할 수 있다.
안드로이드 또는 iOS 스마트 단말기는 보통 0.7~1.0 초 정도의 시간동안 사용자가 버튼을 누르고 있으면 롱터치로 판단한다.
따라서 버튼을 누르고 있는동안 0.1초 간격으로 타이머를 발생시켜 그 횟수를 측정하면 된다.
[Method]
1. OnMouseDown : Timer Start2. OnMouseUp : Count Timer ~ Short Touch Event
3. OnTimer : Increase Timer Count ~ Long Touch Event
[Example source code]
1. Timer Initialize
- Enable : False
- Interval : 100 (msec)
2. Global variable declaration
var ClickInterval : Cardinal = 0; const LONG_TIME = 8; // Long Touch Time : 0.8 sec |
3. Event Handlers work
procedure TForm1.ListBoxItem1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin ClickInterval := 0; Timer1.Enabled := TRUE; end; //********************************************************************************** // Short Touch procedure TForm1.ListBoxItem1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin if ClickInterval < LONG_TIME then begin Timer1.Enabled := FALSE; ClickInterval := 0; ShowMessage( 'ListBox Shot Touch..!!'); end; end; //*************************************************************************************** // Long Touch // Called once every 0.1 seconds -> When the 8th call is a Long touch procedure TForm1.Timer1Timer(Sender: TObject); begin ClickInterval := ClickInterval + 1; if ( ClickInterval = LONG_TIME ) then begin Timer1.Enabled := FALSE; ShowMessage( 'ListBox Long Touch..!!'); end; end; |
Full Source Download (Delphi XE7)
Scientific Calculator Mu can transfer result data to PC or Mac.
SCalc Mu (ver 2.0.0) can transfer result data to PC or Mac.
Click here to see about main feature.
The connection between the two devices use the network protocol, so two device must be in the same network area or PC(or Mac) should have a public IP Address.
(Connection to IP Address on port 55533)
On a PC or Mac, run the 'SCalc Mu Receiver' application.
The transmitted data is all stored in the 'SCalc Mu Receiver' and you can export to CSV file.
새로운 버전의 Scientific Calculator Mu는 계산된 결과값을 Windows PC 또는 MAC OS X 의 클립보드로 바로 전송하여 Excel이나 CAD 프로그램등에서 붙여넣기(Ctrl+V) 하여 사용할 수 있습니다.
두 디바이스간의 연결 방법은 네트워크 프로토콜 방식이므로 단말기와 PC가 같은 네트워크 클래스에 존재하거나 PC 또는 Mac이 real IP Address를 사용하고 있으면 됩니다.
PC 나 Mac에서는 'SCalc Mu Receiver' 어플리케이션을 실행 시켜 놓기만 하면 됩니다.
전송된 값은 'SCalc Mu Receiver' 에 모두 저장되어 CSV 파일로 Export도 가능 합니다.
Korea Weather Forecast by GPS location.
♦ 현위치 GPS좌표추적 정확한 날씨예보 및 현재날씨
♦ 3시간 간격 3일예보
♦ 읍면동단위 지역선택
♦ 레져,여행 매니아를 위한 특수지역 날씨정보
♦ 날씨 화면 공유 기능 (카톡 및 각종 SNS )
♦ 특정지역 및 현재위치 북마크 기능.
♦ 3시간단위 온도,습도,풍속,비올확율,강우량 정보제공
♦ 시인성 높은 깔끔한 디자인
♦ 3시간 간격 3일예보
♦ 읍면동단위 지역선택
♦ 레져,여행 매니아를 위한 특수지역 날씨정보
♦ 날씨 화면 공유 기능 (카톡 및 각종 SNS )
♦ 특정지역 및 현재위치 북마크 기능.
♦ 3시간단위 온도,습도,풍속,비올확율,강우량 정보제공
♦ 시인성 높은 깔끔한 디자인
Roulette 3D Game: Android and iOS App.
This App is a Roulette 3D game.
Roulette rotation and arrow flying play in the FireMonkey 3D environment.
The laws of physics apply to the flight of the arrow
Android App Store
https://play.google.com/store/apps/details?id=com.c2design.Roulette3D
iOS App Store
https://itunes.apple.com/th/app/roulette-3d-rotation/id888577718?mt=8
Roulette rotation and arrow flying play in the FireMonkey 3D environment.
The laws of physics apply to the flight of the arrow
Android App Store
https://play.google.com/store/apps/details?id=com.c2design.Roulette3D
iOS App Store
https://itunes.apple.com/th/app/roulette-3d-rotation/id888577718?mt=8
File transfer status display animation
- TImpFileStream class ( made by J.H Park )
- Mobile screen freezing resolved
- Do not need to use thread.
procedure TForm1.NoThredDown_btClick(Sender: TObject); var i : integer; mHTTP: TIdHTTP; SaveFile, URL : string; fsSource : TImpFileStream; // TFileStream; begin SpeedButton1Click( Sender ); SaveFile := ResPath + FileNameEdit.Text; URL := URLEdit.Text + FileNameEdit.Text; if FileExists( SaveFile ) then fsSource := TImpFileStream.Create( SaveFile, fmOpenWrite ) else fsSource := TImpFileStream.Create( SaveFile, fmCreate ); try //----------------------------------------------------- fsSource.OnPositionChange := FilePositionChange; if fsSource.Size = 0 then ProgressBar1.Max := 3454761 else ProgressBar1.Max := fsSource.Size; ProgressBar1.Value := 0; Pie1.Opacity := 0.6; Pie1.EndAngle := -90; Pie1.StartAngle := -90; //----------------------------------------------------- mHTTP := TIdHTTP.Create(nil); mHttp.Get( URL, fsSource ); // 다운받아 파일 저장 finally fsSource.Free; mHTTP.Free; DownImage.MultiResBitmap.Items[0].Bitmap.LoadFromFile( SaveFile ); end; end; //------------------------------------------------------------------------------------------------------------------------------- procedure TForm1.FilePositionChange(Sender: TObject; OldPos, NewPos: integer); var rate : single; begin ProgressBar1.Value := NewPos; Label1.Text := IntToStr( NewPos ) + ' Bytes'; // 파이그래프 표시 -------------------------------------------------- Pie1.EndAngle := 360 * NewPos / ProgressBar1.Max + Pie1.StartAngle; rate := ( Pie1.EndAngle - Pie1.StartAngle ) * 100 / 360; RateText.Text := Format( '%.0f' , [rate] ) + '%'; if rate >= 100 then Pie1.AnimateFloatDelay( 'Opacity', 0.0, 1.5, 1.0 ); // 보여주고 사라짐. Application.ProcessMessages; end; |
TImpFileStream 클래스는 전혀 수정할 필요없이 그대로 사용하면 되며 모바일 화면에서 UI만 구현하면 됩니다.
모바일환경에서 파일송수신 상태일때는 화면이 프리징되는 현상이 생겨 이를 해결하기 위해서 쓰레드를 사용하거나 하였는데 여의치 않은 경우가 많았죠.
TImpFileStream 클래스는 쓰레드를 사용하지 않고도 화면에서 실시간으로 다운로드 상태를 표현 할수 있어서 아주 유용할것으로 판단 됩니다. (당연한 얘기지만 필요시 쓰레드 사용도 가능합니다.)
제작한 샘플은 원격서버에서 이미지 파일을 다운로드 받아 모바일 화면에 표시합니다.
파일 다운로드 상태를 표시하기 위해서는 파일크기를 알아야 하겠죠.
샘플에서는 편의상 최초 다운로드시에는 파일사이즈를 지정 했습니다.
실제 서비스 할때는 다운로드 파일이 결정이 된상태이기 때문에 어떤방법으로던지 파일사이즈를 미리 알려주기만 하면 되므로 간단한 문제 입니다.
DB에서 파일리스트를 받아온다면 파일크기도 같이 가져오면 되고, 웹에서 다운받는다면 xml 노드에 파일명과 파일크기를 같이 기록해 두면 될것 입니다.
파일사이즈가 변하는 환경이라면 다운로드 전에 미리 파일정보만 획득하는 방법도 있을것입니다.
그리고 이미지 파일 다운로드 상태를 표현하기 위해 대형사이즈의 파일로 테스트를 해보니
고해상도의 이미지 경우는 단말기에 따라 Bitmap.LoadFromFile 시 런타임 에러가 나는 경우가 있습니다.
역시 서비스시에는 모바일 화면에 맞는 적절한 크기의 이미지를 사용해야 하겠죠. (썸내일 표시등 ,주석 참조)
다운로드 자체는 전혀 문제가 없습니다.
샘플 제작하는 김에 TPie를 이용해서 원형 프로그래스바를 만들어 보았으니 같이 참조해서 보시면 도움이 될것 입니다.
전체 프로젝트는 첨부로 올립니다.
(참고로 샘플 프로젝트 서버는 항시 접속할수 있는것이 아니니 접속이 안되면 각자의 서버에서 활용해 보시기 바랍니다.)
Open Source Project - Ladder Game
This App is a popular simple ladder game in Korea.
The full source of Delphi XE5 is available.
Android
https://play.google.com/store/apps/details?id=com.c2design.CLadder
iOS
https://itunes.apple.com/us/app/kkwang-sadaligeim/id882526532
Source Download
Scientific Calculator Mu with my Formulas.
This is the ONLY APP that can execute own Formulas as well as normal calculation.
이 계산기는 일반 수식 계산뿐 아니라 사용자가 작성한 공식도 계산이 가능한 유일한 앱 입니다.
iOS Mu PRO download
Android Mu Lite download
♦ You can both execute User Formulas, as well as normal calculation.
♦ You can create your own formulas and save them in User Memory until you need them.
♦ In User Formulas, you can use English alphabets, Greeks and any symbols, such as a subscript.
♦ You can create User Formulas almost exactly identical as the mathematical equations.
♦ Once a formula is saved, it can be executed at any time by specifying the formula memory number.
♦ Once you execute a formula, subsequent operation depends on the type of formula that you recalled.
( For example, '?' may appear to tell you to input values for variables.)
♦ You can add another equations during calculation.
♦ Abbreviated multiplication and nested parentheses can be expressed exactly same way as real formulas.
♦ You can use the calculated values repeatedly by just one-touch.
♦ Saved data in Memory can be used anytime you want during both normal calculation and Formulas.
♦ You can use the saved data in User Formulas.
( Nothing effects to User Formulas although the saved data being deleted.)
♦ Appearance is identical to that of classics calculator, with providing better functions by touch screen and touch scroll.
♦ Landscape mode supported.
[Functions include]
♦ Power & Root Functions
♦ Log Functions.
♦ Trigonometric functions in degree or radian
♦ Arcsine , Arccosine, Arctangent
♦ Hyperbolic sine, Hyperbolic cosine, Hyperbolic tangent
♦ Hyperbolic Arcsine, Hyperbolic Arccosine, Hyperbolic Arctangent
♦ Factorial
♦ In PRO version, User Formulas and Memory data can be saved unlimited.
* 사용자가 원하는 공식을 마음대로 만들수 있습니다.
* 만들어진 공식은 저장하여 호출해서 사용이 가능 합니다.
* 공식은 알파벳 문자는 물론 그리스문자와 첨자까지 사용이 가능합니다.
* 실제 수학식과 거의 동일한 형태로 공식을 만들어 사용 할 수 있습니다.
* 생략연산자 중첩괄호 지수등도 수학식과 동일하게 표현 됩니다.
* 작성된 공식은 즉시 호출되어 변수값만 입력하면 반복 계산이 가능 합니다.
(공식을 실행하면 '?'가 표시되고 이곳에 변수값을 입력만 하면 됩니다.)
* 공식 계산시 변수값에 또다른 수식을 입력하여 계산이 가능 합니다.
* 계산된 결과값을 메모리에 저장하여 수식과 공식에 모두 활용 가능합니다.
* 공식에 사용된 메모리값은 메모리 데이터가 삭제되어도 관계없이 사용 할 수 있습니다.
* 실제 계산기의 모습이지만 실제 계산기보다 편리한 화면터치및 스크롤 기능을 제공하여 직관적인 사용이 가능 합니다.
* 가로모드도 지원이 되므로 긴 수식일 경우 활용 하시기 바랍니다.
* 라이트 버전은 공식과 메모리를 3개까지만 저장이 가능합니다.
* 프로버전은 제한없이 사용이 가능 합니다.
[주요계산 기능]
* 지수, 루트 계산
* 로그함수
* Degree 및 Radian 삼각함수
* Arcsine , Arccosine, Arctangent
* Hyperbolic sine, Hyperbolic cosine, Hyperbolic tangent
* Hyperbolic Arcsine, Hyperbolic Arccosine, Hyperbolic Arctangent
* Factoria
* 사용자가 원하는 공식을 마음대로 만들수 있습니다.
* 만들어진 공식은 저장하여 호출해서 사용이 가능 합니다.
* 공식은 알파벳 문자는 물론 그리스문자와 첨자까지 사용이 가능합니다.
* 실제 수학식과 거의 동일한 형태로 공식을 만들어 사용 할 수 있습니다.
* 생략연산자 중첩괄호 지수등도 수학식과 동일하게 표현 됩니다.
* 작성된 공식은 즉시 호출되어 변수값만 입력하면 반복 계산이 가능 합니다.
(공식을 실행하면 '?'가 표시되고 이곳에 변수값을 입력만 하면 됩니다.)
* 공식 계산시 변수값에 또다른 수식을 입력하여 계산이 가능 합니다.
* 계산된 결과값을 메모리에 저장하여 수식과 공식에 모두 활용 가능합니다.
* 공식에 사용된 메모리값은 메모리 데이터가 삭제되어도 관계없이 사용 할 수 있습니다.
* 실제 계산기의 모습이지만 실제 계산기보다 편리한 화면터치및 스크롤 기능을 제공하여 직관적인 사용이 가능 합니다.
* 가로모드도 지원이 되므로 긴 수식일 경우 활용 하시기 바랍니다.
* 라이트 버전은 공식과 메모리를 3개까지만 저장이 가능합니다.
* 프로버전은 제한없이 사용이 가능 합니다.
[주요계산 기능]
* 지수, 루트 계산
* 로그함수
* Degree 및 Radian 삼각함수
* Arcsine , Arccosine, Arctangent
* Hyperbolic sine, Hyperbolic cosine, Hyperbolic tangent
* Hyperbolic Arcsine, Hyperbolic Arccosine, Hyperbolic Arctangent
* Factoria
About Me.
I’m an Embarcadero MVP!
I am very proud to announce that Embarcadero has appointed me as one of their Most Valuable Professionals!
I am Software Developer with over many years of experience in the area.
My major development tool is the Delphi.
Recently I have been developing mobile apps with Delphi XE2 ~ DelphiXE(?)
All the apps are PURELY built with FireMonkey:
Google play:
https://play.google.com/store/apps/developer?id=c2design
iOS:
https://itunes.apple.com/us/artist/sanghyun-oh/id524356512
I am providing a 2 day training course of “Advanced Delphi Mobile programming” every month in Korea.
And I am running the most active FireMonkey community of Korea:
http://cafe.naver.com/delphifmx
피드 구독하기:
글 (Atom)