Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Galaxy S5 Skin on XE7



Permlink Replies: 10 - Last Post: Nov 7, 2014 9:42 AM Last Post By: Roland Kossow
Hans Werner

Posts: 5
Registered: 11/2/14
Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 29, 2014 2:30 AM
Hi everyone

I am trying to develop an android App with C++ Builder XE7. The problem is, that there are just a few skins that I can choose from. Android 3,5, 4, 5 and 7 inch phones. But I want to develop an app for my Galaxy S5 with an 5.1 inch screen. When i make a 4 inch and a 5 inch android phone skin and than put the app on my Galaxy S5, the skin of the 4 inch skin will appear but not in the dimensions I made the app in C++ Builder. How can I get an original view of my Galaxy S5 directly in the designer?

Thanks al lot!
Best Regards
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 29, 2014 8:47 AM   in response to: Hans Werner in response to: Hans Werner
Look here:

http://docwiki.embarcadero.com/RADStudio/XE7/en/Adding_a_Customized_View_to_the_View_Selector

Hans Werner wrote:
Hi everyone

I am trying to develop an android App with C++ Builder XE7. The problem is, that there are just a few skins that I can choose from. Android 3,5, 4, 5 and 7 inch phones. But I want to develop an app for my Galaxy S5 with an 5.1 inch screen. When i make a 4 inch and a 5 inch android phone skin and than put the app on my Galaxy S5, the skin of the 4 inch skin will appear but not in the dimensions I made the app in C++ Builder. How can I get an original view of my Galaxy S5 directly in the designer?

Thanks al lot!
Best Regards

--
Borja Serrano
Embarcadero Technical Support Engineer
Hans Werner

Posts: 5
Registered: 11/2/14
Re: Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 29, 2014 1:30 PM   in response to: Borja Serrano in response to: Borja Serrano
Borja Serrano wrote:
Look here:

http://docwiki.embarcadero.com/RADStudio/XE7/en/Adding_a_Customized_View_to_the_View_Selector

Hans Werner wrote:
Hi everyone

I am trying to develop an android App with C++ Builder XE7. The problem is, that there are just a few skins that I can choose from. Android 3,5, 4, 5 and 7 inch phones. But I want to develop an app for my Galaxy S5 with an 5.1 inch screen. When i make a 4 inch and a 5 inch android phone skin and than put the app on my Galaxy S5, the skin of the 4 inch skin will appear but not in the dimensions I made the app in C++ Builder. How can I get an original view of my Galaxy S5 directly in the designer?

Thanks al lot!
Best Regards

--
Borja Serrano
Embarcadero Technical Support Engineer

Hi, thanks for your reply but I still have problems with the screensize. Specs of Galaxy S5 are: 1920x1080 with 432ppi. I did the following:

void initdevice() {
 
	TDeviceInfo::AddDevice(TDeviceInfo::TDeviceClass::Phone, "GalaxyS5",
		TSize(1920, 1080), TSize(1920 / 2, 1080 / 2), TSize(1920, 1080),
		TSize(1920 / 2, 1080 / 2), TOSVersion::TPlatform::pfAndroid, 432);
}


and added this to the MobileDevices.xml:

<MobileDevice>
	<Displayname>GalaxyS5</Displayname>
	<Order>2051</Order>
	<Default>True</Default>
	<Name>GalaxyS5</Name>
	<DevicePlatform Default="True">3</DevicePlatform>
	<FormFactor>2</FormFactor>
	<Portrait Enabled="True" Width="450" Height="720" Top="60" Left="25" StatusbarHeight="25" StatusBarPos="0" Artwork=""/>
	<UpsideDown Enabled="True" Width="450" Height="720" Top="81" Left="29" StatusbarHeight="25" StatusBarPos="0" Artwork=""/>
	<LandscapeLeft Enabled="True" Width="720" Height="450" Top="25" Left="81" StatusbarHeight="25" StatusBarPos="0" Artwork=""/>
        <LandscapeRight Enabled="True" Width="720" Height="450" Top="29" Left="60" StatusbarHeight="25" StatusBarPos="0" Artwork=""/>
</MobileDevice>


I have now the GalaxyS5 view in my list and I can choose it and it is displayed correctly in C++ Builder. But when I put it to the Galaxy S5, it still displays the 4 inch Phone layout.

What did I wrong? I don't get it...
Best regards
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 30, 2014 9:22 AM   in response to: Hans Werner in response to: Hans Werner
Try this:

void initdevice() {

TDeviceInfo::AddDevice(TDeviceInfo::TDeviceClass::Phone, "GalaxyS5",
TSize(1920, 1080), TSize(1920 / 3, 1080 / 3), TOSVersion::TPlatform::pfAndroid, 432);
}

You can put ranges (as you put) or the exact size. As far as I know, the Css pixel ratio in the S5 is 3 (it was 3 in the S4), so the logical size is calculated dividing by 3.

and in the "xml" put:

<Portrait Enabled="True" Width="360" Height="640" Top="60" Left="25" StatusbarHeight="25" StatusBarPos="0" Artwork=""/>

There is a good post about it at: http://delphi.org/2014/09/hello-moto-360-from-delphi-xe7/

Hope this helps.
Hans Werner

Posts: 5
Registered: 11/2/14
Re: Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 30, 2014 1:17 PM   in response to: Borja Serrano in response to: Borja Serrano
Borja Serrano wrote:
Try this:

void initdevice() {

TDeviceInfo::AddDevice(TDeviceInfo::TDeviceClass::Phone, "GalaxyS5",
TSize(1920, 1080), TSize(1920 / 3, 1080 / 3), TOSVersion::TPlatform::pfAndroid, 432);
}

You can put ranges (as you put) or the exact size. As far as I know, the Css pixel ratio in the S5 is 3 (it was 3 in the S4), so the logical size is calculated dividing by 3.

and in the "xml" put:

<Portrait Enabled="True" Width="360" Height="640" Top="60" Left="25" StatusbarHeight="25" StatusBarPos="0" Artwork=""/>

There is a good post about it at: http://delphi.org/2014/09/hello-moto-360-from-delphi-xe7/

Hope this helps.

Doesn't work either. I did everything like in this post and from this site: http://docwiki.embarcadero.com/RADStudio/XE7/en/Adding_a_Customized_View_to_the_View_Selector#Customizing_the_Form_for_a_New_View

I created I new project and added a text label in the master. Then, I added the Galaxy S5 View und the 4 and 5 inch phone as well. In every phone view I named the label same as phone type. But when I run it on my Galaxy S5 the 4 inch version appears.

I really don't know whats wrong :S
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 31, 2014 9:39 AM   in response to: Hans Werner in response to: Hans Werner
Then, it seems that there is a bug. I don't have an S5 device to test so I suggest you to open a defect in the Quality Portal (htttp://quality.embarcadero.com) so that it can be checked for newer updates and releases
Hans Werner

Posts: 5
Registered: 11/2/14
Re: Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 1, 2014 10:41 AM   in response to: Hans Werner in response to: Hans Werner
Same error with my Galaxy S3. Unfortunately I don't have another Android phone to test it. Anyone other hasa Galaxy S5/S3 to test it? Maybe someone can confirm this is a bug...
Mike Laudou

Posts: 22
Registered: 10/20/14
Re: Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 4, 2014 2:34 AM   in response to: Hans Werner in response to: Hans Werner
Same for me on S4...

What we need to know is: "how the most appropriate view is selected for the target device at run time"
Is it a way to force/override that from code?

Regards,
Roland Kossow

Posts: 77
Registered: 9/23/99
Re: Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 4, 2014 11:46 AM   in response to: Mike Laudou in response to: Mike Laudou
Try this ...

=======
unit uSamsungGalaxyS4Device;

interface

implementation

uses

system.Devices, system.Types, system.SysUtils;

const
ViewName = 'GalaxyS4'; // The name of the view.

initialization

TDeviceinfo.AddDevice(TDeviceinfo.TDeviceClass.Phone, ViewName,
TSize.Create(1080, 1920), TSize.Create(360, 640), // MinPhysicalSize(max, min), MinLogicalSize(max, min)
TOSVersion.TPlatform.pfAndroid, 441); //Select the platform and the pixel density.

finalization

TDeviceinfo.RemoveDevice(ViewName); // To unregister the view after unistalling the package.

end.
============

and

============
<MobileDevice>
<Displayname>Galaxy S4</Displayname>
<Order>2050</Order>
<Default>True</Default>
<Name>GalaxyS4</Name>
<DevicePlatform Default="True">3</DevicePlatform>
<FormFactor>2</FormFactor>
<Portrait Enabled="True" Width="360" Height="640" Top="60" Left="25" StatusbarHeight="25" StatusBarPos="0" Artwork="" />
<UpsideDown Enabled="True" Width="360" Height="640" Top="81" Left="29" StatusbarHeight="25" StatusBarPos="0" Artwork="" />
<LandscapeLeft Enabled="True" Width="640" Height="360" Top="25" Left="81" StatusbarHeight="25" StatusBarPos="0" Artwork="" />
<LandscapeRight Enabled="True" Width="640" Height="360" Top="29" Left="60" StatusbarHeight="25" StatusBarPos="0" Artwork="" />
</MobileDevice>
=============
Mike Laudou

Posts: 22
Registered: 10/20/14
Re: Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 7, 2014 9:31 AM   in response to: Roland Kossow in response to: Roland Kossow
No, it does not work on my S4.
I'm able to see the galaxy S4 view in the IDE....
But at run time the 5'' view is selected on the device :-(
Roland Kossow

Posts: 77
Registered: 9/23/99
Re: Galaxy S5 Skin on XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 7, 2014 9:42 AM   in response to: Mike Laudou in response to: Mike Laudou
Hi.
Yes I also figured it out now. It works only at designtime.
https://quality.embarcadero.com/browse/RSP-9686
Logged a bug - please vote up.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02