Ricky Gai

Member since: Wednesday, 03 June 2015
Last login: 7 years ago
Profile viewed: 769 views

No Rank
Points: 0

Ricky Gai created a new topic ' Unable to attach file to GMail, Dropbox...etc' in the forum. 7 years ago

Embarcadero® C++Builder XE8 Version 22.0.19027.8951 and Indy 10.Window 10 Pro x64, Version 10.0.10240Android 4.1.2
QUESTIONS
1. How to attach a file to an application eg. Dropbox, GMail... etc ?
Below is the current sample source but still unable to attach a file to GMail, Dropbox...etc
_di_JIntent oIntent;_di_Jnet_Uri oURI;_di_JFile oPath;_di_JFile oFile;
UnicodeString us;UnicodeStirng usFName;UnicodeString usPathPublic;
// UNICODE.TXT is a file that copied into usPath dynamically, it is confirmed there.usFName = L"UNICODE.TXT";
// usPath....is gained via System::Ioutils::TPath::GetPublicPath() as "/storage/sdcard0/Android/data/com.embarcadero.MBXC/files"usPath = System::Ioutils::TPath::GetPublicPath();
// NOTE: Both methods below also failed to attach a file into GMail or Dropbox...etc
#if 0 // Method 1
oPath = TJFile::JavaClass->init( StringToJString( usPath ) );oFile = TJFile::JavaClass->init( oPath, StringToJString( usFName ) );oURI = TJnet_Uri::JavaClass->fromFile( oFile );
#else // Method 2
us = usPath + L"/" + usFName;oURI = TJnet_Uri::JavaClass->parse( StringToJString( L"file://" + us ) );
#endif
// NOTE: oURI.toString() is "file:///storage/sdcard0/Android/data/com.embarcadero.MBXC/files/UNICODE.TXT"oURI = TJnet_Uri::JavaClass->parse( StringToJString( us ) );
try{oIntent = TJIntent::JavaClass->init();
if( oIntent ){oIntent->setAction( TJIntent::JavaClass->ACTION_SEND );
oIntent->setType( StringToJString( "application/*" ) );
_di_JArrayList arr = TJArrayList::JavaClass->init();arr->add( oURI );oIntent->putParcelableArrayListExtra( TJIntent::JavaClass->EXTRA_STREAM, arr );
oIntent->setFlags( TJIntent::JavaClass->FLAG_ACTIVITY_NEW_TASK );
::SharedActivityContext()->startActivity( oIntent );}}catch( Exception& e ){ShowMessage( e.Message );}
Please advise.

Read More...

Ricky Gai replied to the topic 'CBXE8 - IDE hangs and freezes while editing.' in the forum. 7 years ago

This issues happened on both my notebook and desktop computers with CBXE8 same version installed.
Currently it happened on Android platform development during source editing, I try to find the reason why and what is lagging behind but until now also no answer.
Therefore, don't think creating simulation application can solve the issues but I will try.

Read More...

Ricky Gai created a new topic ' EListError while changing TLabel FontColor ?' in the forum. 7 years ago

Embarcadero® C++Builder XE8 Version 22.0.19027.8951 and Indy 10.Window 10 Pro x64Android 4.1.2
QUESTIONS
1. When dynamically changing TLabel FontColor via the following method below where lbText...is TLabel component and is initialized with ssFontColor removed, I am not sure why removing ssFontColor, as just followed articles stated on web due to lack information.
lbText->StyledSettings = lbText->StyledSettings >> TStyledSetting::ssFontColor;
Later I change the FontColor via:
void OnText (void) { lbText->TextSettings->FontColor = TAlphaColor( claSkyblue ); };
void OnError(void) { lbText->TextSettings->FontColor = TAlphaColor( claTomato ); };
The compiler reported the following error:
Project XXX.apk raised exception class EListError with message 'Duplicate not allowed'.
Please advise.

Read More...

Ricky Gai created a new topic ' TLabel OnClick() and OnTap() events are not firing' in the forum. 7 years ago

*Embarcadero® C++Builder XE8 Version 22.0.19027.8951 and Indy 10.**Window 10 Pro x64**Android 4.1.2*
*QUESTIONS*
1. TLabel OnClick and OnTap() events are not firing, how come ?
Please advise.

Read More...

Ricky Gai created a new topic ' How to spawnl an app, service with para passing ?' in the forum. 7 years ago

Embarcadero® C++Builder XE8 Version 22.0.19027.8951 and Indy 10.Window 10 Pro x64Android 4.1.2
QUESTIONS
1. I have encrypted a file then wish to send to recipient via Bluetooth, Wifi-Direct or Gmail with file path as parameter, how do I call ( spawnl ) the application in Android and iOS ?
eg.
_spawnl( "application.exe", "\user\myfiles\encrypted.txt" );
Please advise.

Read More...

Ricky Gai created a new topic ' Fastest way to get number of files & sub-folders ?' in the forum. 7 years ago

Embarcadero® C++Builder XE8 Version 22.0.19027.8951 and Indy 10.Window 10 Pro x64Android 4.1.2
QUESTIONS:
1. Is there a way to get the number of files and folders within a directory, eg. ./*.* ?
The reason is, enumerating the path "./" and its sub-folders will take time to complete. I really needs a solution to obtain a folder information such as below:
GetDirectoryInfo( UnicodeString( L"./usr" ), &iFolderCount, &iFileCount );
Is there such method or any other solutions is greatly appreciated.
Please advise.

Read More...

Ricky Gai created a new topic ' CBXE8 - IDE hangs and freezes within 2-3 minutes u' in the forum. 7 years ago

Embarcadero® C++Builder XE8 Version 22.0.19027.8951 and Indy 10.Window 10 Pro x64
I encountered the CBXE8 IDE hangs during Android mobile coding or editing and resulted in "NOT RESPONDING".
This issues had been happening quite frequent during Windows 8 Pro x64 as well.
I am not sure what options setting causing this "hanging" or "waiting" stage, sometime it resumes normally, or just hang there.
However, I changed few of header file format from Little Endian to ANSI.
The reason this change is made is because this header files were used in Visual Studio as UNICODE format and when compiled under CBXE8, it reported 'NULL' character warning.
After changing to ANSI file format, I noticed the "waiting" or "hang" problem is not happening ( it does pause a while but resumed as normal ).
It looks to me something is writing at background during code editing. I am not sure what is going wrong ?
Please advise.

Read More...