Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

How to use this function below, you can explain in detail the IGallery use,
for xample give us a small Demo so on .

Look forward to it , thank you

Hi Gao Feng,
Can you please specify the function you want information on? I think you may have forgotten to mention the function.
Thanks,
Anand

Hi Gao Feng,
Can you please specify the function you want information on? I think you may have forgotten to mention the function.
Thanks,
Anand

Hi Anand ,
Thank you for you replay.
the function as follows :
int IGallery_Query(... ISQLStmt **ppiSQLStmt);
How to from the last parameter will the query data read out
last parameter store query result data, how to read the data from it?
My Demo is as following:
-------------------------------------------------------------------------------
int PictrueGallery_GetGalleryDBDir(myfirstwidgetapp *pMe)
{
int nRet = SUCCESS;
ISHELL_CreateInstance(pMe->piShell, AEECLSID_Gallery, &pMe->piGallery);
nRet = IGallery_MountDirs(pMe->piGallery,IMAGE_ENUM_TYPE );
nRet = IGallery_Sync(pMe->piGallery,IMAGE_ENUM_TYPE,PictureGallery_SyncNotifyCB, pData);
return nRet;

int PictureGallery_Query(myfirstwidgetapp *pMe)
{
int nRet = SUCCESS;
const AECHAR *pwszSetClause = AEEGALLERY_ARTIST_COL ;
const AECHAR *pwszResultCols = L * ;
const AECHAR *pwszWhereClause = L ;
const AECHAR *pwszGroupByClause = L "";
const AECHAR *pwszHavingClause = L "";
const AECHAR *pwszOrderByClause = L "";
const AECHAR *pwszLimit = L "";
const AECHAR *pwszOffset = L "";
ISQLStmt *piSQLStmt;
IGallery_Query(pMe->piGallery, pwszResultCols,pwszWhereClause,
pwszGroupByClause,pwszHavingClause,pwszOrderByClause,
pwszLimit,pwszOffset,&piSQLStmt);
return nRet;

-------------------------------------------------------------------------------
Thanks,
Gao Feng

Hi Anand ,
Thank you for you replay.
the function as follows :
int IGallery_Query(... ISQLStmt **ppiSQLStmt);
How to from the last parameter will the query data read out
last parameter store query result data, how to read the data from it?
My Demo is as following:
-------------------------------------------------------------------------------
int PictrueGallery_GetGalleryDBDir(myfirstwidgetapp *pMe)
{
int nRet = SUCCESS;
ISHELL_CreateInstance(pMe->piShell, AEECLSID_Gallery, &pMe->piGallery);
nRet = IGallery_MountDirs(pMe->piGallery,IMAGE_ENUM_TYPE );
nRet = IGallery_Sync(pMe->piGallery,IMAGE_ENUM_TYPE,PictureGallery_SyncNotifyCB, pData);
return nRet;

int PictureGallery_Query(myfirstwidgetapp *pMe)
{
int nRet = SUCCESS;
const AECHAR *pwszSetClause = AEEGALLERY_ARTIST_COL ;
const AECHAR *pwszResultCols = L * ;
const AECHAR *pwszWhereClause = L ;
const AECHAR *pwszGroupByClause = L "";
const AECHAR *pwszHavingClause = L "";
const AECHAR *pwszOrderByClause = L "";
const AECHAR *pwszLimit = L "";
const AECHAR *pwszOffset = L "";
ISQLStmt *piSQLStmt;
IGallery_Query(pMe->piGallery, pwszResultCols,pwszWhereClause,
pwszGroupByClause,pwszHavingClause,pwszOrderByClause,
pwszLimit,pwszOffset,&piSQLStmt);
return nRet;

-------------------------------------------------------------------------------
Thanks,
Gao Feng

Hi Gao Feng,
I will get help from an IGallery developer to answer your question.
Regards,
Anand

Hi Gao Feng,
I will get help from an IGallery developer to answer your question.
Regards,
Anand

Hi Gao Feng,
Gallery is based on sqlite API, here's some additional info if you're interested:
http://www.sqlite.org/lang.html
http://www.sqlite.org/lang_select.html
First, IMAGE_ENUM_TYPE needs to be a location/URL, for example: "fs:/shared".
So, as an example, if you want to do a simple query like this:
SELECT id, Title, Artist, Album FROM MediaTable WHERE MediaType = 2 ORDER BY FileSize;
You can call this:
nRetVal = IGallery_Query(piGallery,
AEEGALLERY_ID_COL L", " AEEGALLERY_TITLE_COL L", " AEEGALLERY_ARTIST_COL L", " AEEGALLERY_ALBUM_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2",
NULL,
NULL,
AEEGALLERY_FILESIZE_COL,
NULL,
NULL,
&piGalleryQueryStmt);
The Query gives back an ISqlStmt object, and the API is documented at AEESQL.h.
Here's how you read the data from an ISqlStmt object:
1. nRetVal = ISQLSTMT_Step(piGalleryQueryStmt);
If there's any data, it will return SQL_ROW, otherwise it will return SQL_DONE, or some other error code.
2. nRetVal = ISQLSTMT_GetColumnInt(piGalleryQueryStmt, 0, &nID);
nRetVal = ISQLSTMT_GetColumnText(piGalleryQueryStmt, 1, &pszTitle);
nRetVal = ISQLSTMT_GetColumnText(piGalleryQueryStmt, 2, &pszArtist);
nRetVal = ISQLSTMT_GetColumnText(piGalleryQueryStmt, 3, &pszAlbum);
etc.
I hope this answers your question, please write back if you need more clarification.
Thanks,
Edward

Hi Gao Feng,
Gallery is based on sqlite API, here's some additional info if you're interested:
http://www.sqlite.org/lang.html
http://www.sqlite.org/lang_select.html
First, IMAGE_ENUM_TYPE needs to be a location/URL, for example: "fs:/shared".
So, as an example, if you want to do a simple query like this:
SELECT id, Title, Artist, Album FROM MediaTable WHERE MediaType = 2 ORDER BY FileSize;
You can call this:
nRetVal = IGallery_Query(piGallery,
AEEGALLERY_ID_COL L", " AEEGALLERY_TITLE_COL L", " AEEGALLERY_ARTIST_COL L", " AEEGALLERY_ALBUM_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2",
NULL,
NULL,
AEEGALLERY_FILESIZE_COL,
NULL,
NULL,
&piGalleryQueryStmt);
The Query gives back an ISqlStmt object, and the API is documented at AEESQL.h.
Here's how you read the data from an ISqlStmt object:
1. nRetVal = ISQLSTMT_Step(piGalleryQueryStmt);
If there's any data, it will return SQL_ROW, otherwise it will return SQL_DONE, or some other error code.
2. nRetVal = ISQLSTMT_GetColumnInt(piGalleryQueryStmt, 0, &nID);
nRetVal = ISQLSTMT_GetColumnText(piGalleryQueryStmt, 1, &pszTitle);
nRetVal = ISQLSTMT_GetColumnText(piGalleryQueryStmt, 2, &pszArtist);
nRetVal = ISQLSTMT_GetColumnText(piGalleryQueryStmt, 3, &pszAlbum);
etc.
I hope this answers your question, please write back if you need more clarification.
Thanks,
Edward

thank you very much ! )

thank you very much ! )

Hi Edward,
Thank you for you replay.
Under the guidance of you, the basic realization of the method to read database records from IGallery DB.Gallery Problem encountered in the future to ask you.
I wish you a happy work :)
Thanks,
Gao Feng

Hi Edward,
Thank you for you replay.
Under the guidance of you, the basic realization of the method to read database records from IGallery DB.Gallery Problem encountered in the future to ask you.
I wish you a happy work :)
Thanks,
Gao Feng

Hi Edward,
I have a question, As follows:
-------------------------------------------------
Objective: according "ARTIST "group
Grouping conditions "ARTIST "
Grouping Data 5 (MP3)
Look forward to the results:
Cheng Long 2
Han Hong 1
Wang Fei 2
Actual results:
Cheng Long 1
Han Hong 1
Wang Fei 1
Wang Fei 1
Wang Fei 1
--------------------Coding Begin--------------
NRet = IGallery_Query (pMe-> piGallery,
AEEGALLERY_ID_COL L "," AEEGALLERY_TITLE_COL L "," AEEGALLERY_ARTIST_COL L "," AEEGALLERY_FILEDATE_COL L "," AEEGALLERY_FILE_COL,
AEEGALLERY_MEDIATYPE_COL L "= 2",
AEEGALLERY_ARTIST_COL,
NULL, NULL, NULL, NULL,
& piSQLStmt);
nSQLCount = ISQLSTMT_ColumnCount (piSQLStmt);
while (nSQLCount> 0)
(
NRet = ISQLSTMT_Step (piSQLStmt);
nRet = ISQLSTMT_GetColumnInt (piSQLStmt, 0, & pSQLID);
DBGPRINTF ( "ID =% d", pSQLID);
nRet = ISQLSTMT_GetColumnText (piSQLStmt, 1, & pSQLTitle);
DBGPRINTF ( "Title =% s", pSQLTitle);
nRet = ISQLSTMT_GetColumnText (piSQLStmt, 2, & pSQLArtist);
DBGPRINTF ( "ARTIST =% s", pSQLArtist);
NSQLCount -;
)
... ... ....
--------------------Coding End----------------
Where is the problem?
I do not quite understand .
Can you help me?
Thanks,
Gao Feng

Hi Edward,
I have a question, As follows:
-------------------------------------------------
Objective: according "ARTIST "group
Grouping conditions "ARTIST "
Grouping Data 5 (MP3)
Look forward to the results:
Cheng Long 2
Han Hong 1
Wang Fei 2
Actual results:
Cheng Long 1
Han Hong 1
Wang Fei 1
Wang Fei 1
Wang Fei 1
--------------------Coding Begin--------------
NRet = IGallery_Query (pMe-> piGallery,
AEEGALLERY_ID_COL L "," AEEGALLERY_TITLE_COL L "," AEEGALLERY_ARTIST_COL L "," AEEGALLERY_FILEDATE_COL L "," AEEGALLERY_FILE_COL,
AEEGALLERY_MEDIATYPE_COL L "= 2",
AEEGALLERY_ARTIST_COL,
NULL, NULL, NULL, NULL,
& piSQLStmt);
nSQLCount = ISQLSTMT_ColumnCount (piSQLStmt);
while (nSQLCount> 0)
(
NRet = ISQLSTMT_Step (piSQLStmt);
nRet = ISQLSTMT_GetColumnInt (piSQLStmt, 0, & pSQLID);
DBGPRINTF ( "ID =% d", pSQLID);
nRet = ISQLSTMT_GetColumnText (piSQLStmt, 1, & pSQLTitle);
DBGPRINTF ( "Title =% s", pSQLTitle);
nRet = ISQLSTMT_GetColumnText (piSQLStmt, 2, & pSQLArtist);
DBGPRINTF ( "ARTIST =% s", pSQLArtist);
NSQLCount -;
)
... ... ....
--------------------Coding End----------------
Where is the problem?
I do not quite understand .
Can you help me?
Thanks,
Gao Feng

Hi Gao Feng,
ISQLSTMT_ColumnCount will return the number of columns in your query (in this case 5: id, Title, Artist, FileDate, and FullPath). That's why you're printing 5 times there.
There's actually no way to get the number of rows of the results of the query (except by doing a separate query with COUNT: like "SELECT COUNT ...").
What you want to do is step through the statements until it returns SQL_DONE (SQL_ROW means there's a result row available):
while (SQL_ROW == (nRet = ISQLSTMT_Step(...)))
{
ISQLSTMT_GetColumn... // Read all the columns you want here
...

if (SQL_DONE == nRet)
{
// Stepping completed successfully through all of the results

else
{
// There's an error, do error handling

Hi Gao Feng,
ISQLSTMT_ColumnCount will return the number of columns in your query (in this case 5: id, Title, Artist, FileDate, and FullPath). That's why you're printing 5 times there.
There's actually no way to get the number of rows of the results of the query (except by doing a separate query with COUNT: like "SELECT COUNT ...").
What you want to do is step through the statements until it returns SQL_DONE (SQL_ROW means there's a result row available):
while (SQL_ROW == (nRet = ISQLSTMT_Step(...)))
{
ISQLSTMT_GetColumn... // Read all the columns you want here
...

if (SQL_DONE == nRet)
{
// Stepping completed successfully through all of the results

else
{
// There's an error, do error handling

Hi Edward,
Thank you for your help.
how to read Mp3 in the value of Bit Rate 192kbps.
can you give me Suggestions?
Thanks,
Gao Feng

Hi Edward,
Thank you for your help.
how to read Mp3 in the value of Bit Rate 192kbps.
can you give me Suggestions?
Thanks,
Gao Feng

Hi Gao Feng,
Can you clarify your question? Do you want to play the mp3 file or insert an entry for it in Gallery?
If you want to insert an entry, you can just call _Sync (the same as any other file). Are you seeing any problem specifically for an mp3 with 192 kbps bit rate?

Hi Gao Feng,
Can you clarify your question? Do you want to play the mp3 file or insert an entry for it in Gallery?
If you want to insert an entry, you can just call _Sync (the same as any other file). Are you seeing any problem specifically for an mp3 with 192 kbps bit rate?

Hi Edward,
Thank you for your help.
----------------------------------------------------------------------------------
I would like to read from the DB size of Mp3 and date, use this method ISQLSTMT_GetColumnText () does not have read the success. How to read this data ?
Can you help me?
----------------------------------------------------------------------------------
Thanks,
Gao Feng

Hi Edward,
Thank you for your help.
----------------------------------------------------------------------------------
I would like to read from the DB size of Mp3 and date, use this method ISQLSTMT_GetColumnText () does not have read the success. How to read this data ?
Can you help me?
----------------------------------------------------------------------------------
Thanks,
Gao Feng

Size and date are stored as numbers, so you should use ISQLSTMT_GetColumnInt instead.
Tips: To determine the data type, use ISQLSTMT_ColumnDataType.

Size and date are stored as numbers, so you should use ISQLSTMT_GetColumnInt instead.
Tips: To determine the data type, use ISQLSTMT_ColumnDataType.

Edward,
Thank you for your replay,ou are responsible .
----------------------------------------------------------------------------------
topic 10
pwArtistName = L Anny
nRet = IGallery_Delete(pMe->piGallery,AEEGALLERY_ARTIST_COL L" = Anny ",&piSQLStmt );
nRet = IGallery_Update(pMe->piGallery, NULL, NULL ,piSQLStmt);
The results: delete the implementation of successful
update return value 14
topic 20
nRet = IGallery_Query (pMe-> piGallery,
AEEGALLERY_ARTIST_COL L,
AEEGALLERY_MEDIATYPE_COL L "= 2 and" AEEGALLERY_ARTIST_COL L "= '" pwArtistName L "'" & &
An error has occurred.
Error code as follows:
error C2146: syntax error: missing ')' before identifier 'pwArtistName'
error C2198: 'IGallery_Query': too few arguments for call
error C2059: syntax error: ')'
topic 30
SQLDType = ISQLSTMT_ColumnDataType (piSQLStmt, 2); return for integer
nRet = ISQLSTMT_GetColumnInt (piSQLStmt, 2, & piSQLFileDate);
The results are error!----------------------------------------------------------------------------------
Thanks,
Gao Feng

Edward,
Thank you for your replay,ou are responsible .
----------------------------------------------------------------------------------
topic 10
pwArtistName = L Anny
nRet = IGallery_Delete(pMe->piGallery,AEEGALLERY_ARTIST_COL L" = Anny ",&piSQLStmt );
nRet = IGallery_Update(pMe->piGallery, NULL, NULL ,piSQLStmt);
The results: delete the implementation of successful
update return value 14
topic 20
nRet = IGallery_Query (pMe-> piGallery,
AEEGALLERY_ARTIST_COL L,
AEEGALLERY_MEDIATYPE_COL L "= 2 and" AEEGALLERY_ARTIST_COL L "= '" pwArtistName L "'" & &
An error has occurred.
Error code as follows:
error C2146: syntax error: missing ')' before identifier 'pwArtistName'
error C2198: 'IGallery_Query': too few arguments for call
error C2059: syntax error: ')'
topic 30
SQLDType = ISQLSTMT_ColumnDataType (piSQLStmt, 2); return for integer
nRet = ISQLSTMT_GetColumnInt (piSQLStmt, 2, & piSQLFileDate);
The results are error!----------------------------------------------------------------------------------
Thanks,
Gao Feng

Hey Gao Feng,
Topic 1.
The _Update API is used to change the value of columns in selected rows of a table:
http://www.sqlite.org/lang_update.html
This can not be called with the SET clause = NULL because then you're not updating anything.
Delete will change the gallery db state by itself, don't need to call update to "update" it, in case this is what you're trying to do.
Topic 2.
You can use _Bind... APIs for this case.
For example, you can use this WHERE clause:
"MediaType = ?1 AND Artist = ?2"
And then call:
ISQLSTMT_BindInt(piStmt, 1 /* this is the ?1 */, nMediaType /* nMediaType = 2 */);
ISQLSTMT_BindWText(
piStmt,
2 /* this is for the ?2 */,
pwArtistName,
-1 /* Let SQLSTMT figure out the string size */,
-1 /* SQLSTMT would make a copy of the data */);
Topic 3.
Have you called ISQLSTMT_Step before any of those? What does _Step returns? If it returns SQL_DONE that means there's no match for your query. _Step needs to return SQL_ROW before you can get the result (and call _GetColumnInt/Text).

Hey Gao Feng,
Topic 1.
The _Update API is used to change the value of columns in selected rows of a table:
http://www.sqlite.org/lang_update.html
This can not be called with the SET clause = NULL because then you're not updating anything.
Delete will change the gallery db state by itself, don't need to call update to "update" it, in case this is what you're trying to do.
Topic 2.
You can use _Bind... APIs for this case.
For example, you can use this WHERE clause:
"MediaType = ?1 AND Artist = ?2"
And then call:
ISQLSTMT_BindInt(piStmt, 1 /* this is the ?1 */, nMediaType /* nMediaType = 2 */);
ISQLSTMT_BindWText(
piStmt,
2 /* this is for the ?2 */,
pwArtistName,
-1 /* Let SQLSTMT figure out the string size */,
-1 /* SQLSTMT would make a copy of the data */);
Topic 3.
Have you called ISQLSTMT_Step before any of those? What does _Step returns? If it returns SQL_DONE that means there's no match for your query. _Step needs to return SQL_ROW before you can get the result (and call _GetColumnInt/Text).

Hey Edward,
Thank you for your reply.
----------------------------------------------------------------------------
"MediaType =? 1 AND Artist =? 2 "
This sentence does not quite understand, I would like where clause to a variable, variable value according to the different access to different results. However, the variables add error !
Like the 1:
10AEEGALLERY_ARTIST_COL L "= 'LiLy'" ---> OK
pwArtistName = L"Maly";
20AEEGALLERY_ARTIST_COL L "= '" pwArtistName L "'" ---> Error
In the where clause what is the format of variables?
----------------------------------------------------------------------------
Thanks,
Gao Feng

Hey Edward,
Thank you for your reply.
----------------------------------------------------------------------------
"MediaType =? 1 AND Artist =? 2 "
This sentence does not quite understand, I would like where clause to a variable, variable value according to the different access to different results. However, the variables add error !
Like the 1:
10AEEGALLERY_ARTIST_COL L "= 'LiLy'" ---> OK
pwArtistName = L"Maly";
20AEEGALLERY_ARTIST_COL L "= '" pwArtistName L "'" ---> Error
In the where clause what is the format of variables?
----------------------------------------------------------------------------
Thanks,
Gao Feng

Edward,
TOpic 3
----------------------------------------------------------------------
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
ISQLSTMT_GetColumnInt(piSQLStmt,2, &piSQLFileDate);
DBGPRINTF("int FileDate = %d", piSQLFileDate);

The results:
FileDate = 932183703
----------------------------------------------------------------------
Thanks,
Gao Feng

Edward,
TOpic 3
----------------------------------------------------------------------
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
ISQLSTMT_GetColumnInt(piSQLStmt,2, &piSQLFileDate);
DBGPRINTF("int FileDate = %d", piSQLFileDate);

The results:
FileDate = 932183703
----------------------------------------------------------------------
Thanks,
Gao Feng

Edward,
New topic
-------------------------------------------------------------------------------------
nRet = IGallery_Delete(pMe->piGallery ,AEEGALLERY_ARTIST_COL L" ='Jim'" ,&piSQLStmt);
IGallery_Query(pMe->piGallery, ... ...);
-------------------------------------------------------------------------------------
>> Implementation of the above delete the statements, the return value is 0.
>>Database and then displays all the records, the result is also just delete the record.
Why?
I do not understand it .
Thanks,
Gao Feng

Edward,
New topic
-------------------------------------------------------------------------------------
nRet = IGallery_Delete(pMe->piGallery ,AEEGALLERY_ARTIST_COL L" ='Jim'" ,&piSQLStmt);
IGallery_Query(pMe->piGallery, ... ...);
-------------------------------------------------------------------------------------
>> Implementation of the above delete the statements, the return value is 0.
>>Database and then displays all the records, the result is also just delete the record.
Why?
I do not understand it .
Thanks,
Gao Feng

Topic 2.
How to use variables in a WHERE clause:
You need to "bind" the variable to a prepared statement:
http://www.sqlite.org/c3ref/bind_blob.html
For example, if you want to do:
WHERE clause: AEEGALLERY_ARTIST_COL L "= '" pwArtistName L "'",
then you call
nRetVal = IGallery_Query(
piGallery,
L"*",
AEEGALLERY_ARTIST_COL L "= ?2",
NULL,
NULL,
NULL,
NULL,
NULL,
&piStmt);
and then "bind" the pwArtistName to the "?2" variable placeholder:
ISQLSTMT_BindWText(
piStmt,
2 /* this is for the ?2 */,
pwArtistName,
-1 /* Let SQLSTMT figure out the string size */,
-1 /* SQLSTMT would make a copy of the data */);
Note that ?2 can be ?nnn, nnn being any number.

Topic 2.
How to use variables in a WHERE clause:
You need to "bind" the variable to a prepared statement:
http://www.sqlite.org/c3ref/bind_blob.html
For example, if you want to do:
WHERE clause: AEEGALLERY_ARTIST_COL L "= '" pwArtistName L "'",
then you call
nRetVal = IGallery_Query(
piGallery,
L"*",
AEEGALLERY_ARTIST_COL L "= ?2",
NULL,
NULL,
NULL,
NULL,
NULL,
&piStmt);
and then "bind" the pwArtistName to the "?2" variable placeholder:
ISQLSTMT_BindWText(
piStmt,
2 /* this is for the ?2 */,
pwArtistName,
-1 /* Let SQLSTMT figure out the string size */,
-1 /* SQLSTMT would make a copy of the data */);
Note that ?2 can be ?nnn, nnn being any number.

Topic 3.
You are getting the correct result (FileDate = 932183703). The file creation date is recorded as "elapsed time in seconds since January 6, 1980 00:00:00 GMT".
You can use helper macros such as GETJULIANDATE to convert it to a more readable time.

Topic 3.
You are getting the correct result (FileDate = 932183703). The file creation date is recorded as "elapsed time in seconds since January 6, 1980 00:00:00 GMT".
You can use helper macros such as GETJULIANDATE to convert it to a more readable time.

About the new topic, I'm not sure I understand your question, can you clarify it?

About the new topic, I'm not sure I understand your question, can you clarify it?

Hi Edward ,
Thanks for your response.
Objective: To delete the names equal "LiLy" record.
Part of the code is as follows:
------------------------------------------------------------
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_ARTIST_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2 ,
&
);
/*delete part*/
nRet = IGallery_Delete(pMe->piGallery ,AEEGALLERY_ARTIST_COL L" ='LiLy'"
,&piSQLStmt);
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_ARTIST_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2 ,
&
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(......)))
{
nRet = ISQLSTMT_GetColumnText(piSQLStmt, 0, &pSQLArtist);

------------------------------------------------------------
Look forward to the results:LiLy been deleted.
Actual results: LiLy still exist.
Thanks ,
Gao Feng

Hi Edward ,
Thanks for your response.
Objective: To delete the names equal "LiLy" record.
Part of the code is as follows:
------------------------------------------------------------
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_ARTIST_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2 ,
&
);
/*delete part*/
nRet = IGallery_Delete(pMe->piGallery ,AEEGALLERY_ARTIST_COL L" ='LiLy'"
,&piSQLStmt);
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_ARTIST_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2 ,
&
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(......)))
{
nRet = ISQLSTMT_GetColumnText(piSQLStmt, 0, &pSQLArtist);

------------------------------------------------------------
Look forward to the results:LiLy been deleted.
Actual results: LiLy still exist.
Thanks ,
Gao Feng

Hi Edward ,
Thanks for your response.
Method 1
------------------------------------------------------------
If pwArtistName = L "LiLy"; database There are a number of LiLy.
The implementation of the following statements you can print more than LiLy?
The first step:
nRet = IGallery_Query (pMe-> piGallery,
AEEGALLERY_ID_COL L "," AEEGALLERY_ARTIST_COL L,
AEEGALLERY_MEDIATYPE_COL L "=? 5 and"
AEEGALLERY_ARTIST_COL L "=? 2",
...
);
Step Two:
nRet = ISQLSTMT_BindInt (piSQLStmt, 5, nMediaType);
nRet = ISQLSTMT_BindWText (
PiSQLStmt,
2,
PwArtistName,
-1,
-1
);
DBGPRINTF ( "ArtistName =% s", pwArtistName);
I can only print out one
The other did not print out!
Why?
------------------------------------------------------------
Method 2
------------------------------------------------------------
The first step:
nRet = IGallery_Query (pMe-> piGallery,
AEEGALLERY_ID_COL L "," AEEGALLERY_ARTIST_COL L,
AEEGALLERY_MEDIATYPE_COL L "=? 5 and"
AEEGALLERY_ARTIST_COL L "=? 2",
...
);
Step Two:
nRet = ISQLSTMT_BindInt (piSQLStmt, 5, nMediaType);
nRet = ISQLSTMT_BindWText (
PiSQLStmt,
2,
PwArtistName,
-1,
-1
);
The third step:
while (SQL_ROW == (nRet = ISQLSTMT_Step (piSQLStmt)))
(
nRet = ISQLSTMT_GetColumnInt (piSQLStmt, 0, & pSQLID);
nRet = ISQLSTMT_GetColumnText (piSQLStmt, 1, & pSQLArtist);
)
Can print out all of them.
But the feeling is not quite right.
can you give me some suggestions?
------------------------------------------------------------
Thanks ,
Gao Feng

Hi Edward ,
Thanks for your response.
Method 1
------------------------------------------------------------
If pwArtistName = L "LiLy"; database There are a number of LiLy.
The implementation of the following statements you can print more than LiLy?
The first step:
nRet = IGallery_Query (pMe-> piGallery,
AEEGALLERY_ID_COL L "," AEEGALLERY_ARTIST_COL L,
AEEGALLERY_MEDIATYPE_COL L "=? 5 and"
AEEGALLERY_ARTIST_COL L "=? 2",
...
);
Step Two:
nRet = ISQLSTMT_BindInt (piSQLStmt, 5, nMediaType);
nRet = ISQLSTMT_BindWText (
PiSQLStmt,
2,
PwArtistName,
-1,
-1
);
DBGPRINTF ( "ArtistName =% s", pwArtistName);
I can only print out one
The other did not print out!
Why?
------------------------------------------------------------
Method 2
------------------------------------------------------------
The first step:
nRet = IGallery_Query (pMe-> piGallery,
AEEGALLERY_ID_COL L "," AEEGALLERY_ARTIST_COL L,
AEEGALLERY_MEDIATYPE_COL L "=? 5 and"
AEEGALLERY_ARTIST_COL L "=? 2",
...
);
Step Two:
nRet = ISQLSTMT_BindInt (piSQLStmt, 5, nMediaType);
nRet = ISQLSTMT_BindWText (
PiSQLStmt,
2,
PwArtistName,
-1,
-1
);
The third step:
while (SQL_ROW == (nRet = ISQLSTMT_Step (piSQLStmt)))
(
nRet = ISQLSTMT_GetColumnInt (piSQLStmt, 0, & pSQLID);
nRet = ISQLSTMT_GetColumnText (piSQLStmt, 1, & pSQLArtist);
)
Can print out all of them.
But the feeling is not quite right.
can you give me some suggestions?
------------------------------------------------------------
Thanks ,
Gao Feng

About the delete:
You need to call ISQLSTMT_Step(piSQLStmt) to execute the delete - it should return SQL_DONE, otherwise there's an error.
Note that every gallery calls are just "preparing" the statement, not "executing" them, so you always need to call _Step (except for calls that doesn't return a SQLStmt object, like _Sync).
About the query:
Method 2 is correct. Each _Step call will return a new result row (if available), so if you want to get the full result, stepping through is the right way to do it. Why do you feel that it isn't right?

About the delete:
You need to call ISQLSTMT_Step(piSQLStmt) to execute the delete - it should return SQL_DONE, otherwise there's an error.
Note that every gallery calls are just "preparing" the statement, not "executing" them, so you always need to call _Step (except for calls that doesn't return a SQLStmt object, like _Sync).
About the query:
Method 2 is correct. Each _Step call will return a new result row (if available), so if you want to get the full result, stepping through is the right way to do it. Why do you feel that it isn't right?

Hi Edward ,
Thanks for your reply.
The implementation of the deletion, the query results that have been deleted
However, to restart the simulator, showing all the data, just delete the record also!
Why?
The implementation process is as follows :
---------------------------------------------------------
1.
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
nRet = IGallery_Delete(pMe->piGallery
,AEEGALLERY_ARTIST_COL L" ='LiLy'"
,&piSQLStmt);

2.
IGallery_Query(pMe->piGallery, ...........)
3.
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
//display

---------------------------------------------------------
Thanks,
Gao Feng

Hi Edward ,
Thanks for your reply.
The implementation of the deletion, the query results that have been deleted
However, to restart the simulator, showing all the data, just delete the record also!
Why?
The implementation process is as follows :
---------------------------------------------------------
1.
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
nRet = IGallery_Delete(pMe->piGallery
,AEEGALLERY_ARTIST_COL L" ='LiLy'"
,&piSQLStmt);

2.
IGallery_Query(pMe->piGallery, ...........)
3.
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
//display

---------------------------------------------------------
Thanks,
Gao Feng

Hi Edward ,
---------------------New topic---------------------------
Is there any IGallery database lock,
For example: Two App use the database at the same time, Gallery of him is how to manage?
Can you give me suggestions ?
------------------------------------------------------------
Thanks ,
Gao Feng

Hi Edward ,
---------------------New topic---------------------------
Is there any IGallery database lock,
For example: Two App use the database at the same time, Gallery of him is how to manage?
Can you give me suggestions ?
------------------------------------------------------------
Thanks ,
Gao Feng

About the delete:
Calling IGallery_Delete will not delete the file, just the entry in the db. That's why when you re-sync gallery, it will re-add the entry since the file still exists.
To delete the file, call IFILEMGR_Remove.
About the lock:
If 1 instance of gallery have a lock on the db, no other instances can write to it (it will return SQL_BUSY). In case of _Sync, it will keep trying until the lock is released (sync will not finish until the lock is released). In other cases (like _Update and _Delete), it will return SQL_BUSY immediately and your changes would not be processed. You have to listen to the writable signal to wait for the lock to be released.

About the delete:
Calling IGallery_Delete will not delete the file, just the entry in the db. That's why when you re-sync gallery, it will re-add the entry since the file still exists.
To delete the file, call IFILEMGR_Remove.
About the lock:
If 1 instance of gallery have a lock on the db, no other instances can write to it (it will return SQL_BUSY). In case of _Sync, it will keep trying until the lock is released (sync will not finish until the lock is released). In other cases (like _Update and _Delete), it will return SQL_BUSY immediately and your changes would not be processed. You have to listen to the writable signal to wait for the lock to be released.

Hi Edward ,
To delete a single record has been successfully .
But remove all did not succeed .
Completely deleted as follows:
/*"GetDelStr()"This function is "BaseName = 'jpeg3'", as the deletion of conditions.*/
------------------------------------remove all----------------------------------------------
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_BASENAME_COL L","AEEGALLERY_FILE_COL,
AEEGALLERY_MEDIATYPE_COL L" = 4 ",
...
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
nRet = ISQLSTMT_GetColumnText(piSQLStmt,0, &pSQLBaseName);
nRet = GetDelStr(pSQLBaseName, &pwReturnDelStr);
nRet = ISQLSTMT_GetColumnText(piSQLStmt, 1, &pSQLFileFull);
nRet = IGallery_Delete(pMe->piGallery
,pSQLBaseName
,&piSQLStmt
);
nErr = IFILEMGR_Remove(pIFileMgr, pSQLFileFull);

----------------------------------------------------------------------------------
Can you give me suggestions . . .
Thanks ,
Gao Feng

Hi Edward ,
To delete a single record has been successfully .
But remove all did not succeed .
Completely deleted as follows:
/*"GetDelStr()"This function is "BaseName = 'jpeg3'", as the deletion of conditions.*/
------------------------------------remove all----------------------------------------------
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_BASENAME_COL L","AEEGALLERY_FILE_COL,
AEEGALLERY_MEDIATYPE_COL L" = 4 ",
...
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
nRet = ISQLSTMT_GetColumnText(piSQLStmt,0, &pSQLBaseName);
nRet = GetDelStr(pSQLBaseName, &pwReturnDelStr);
nRet = ISQLSTMT_GetColumnText(piSQLStmt, 1, &pSQLFileFull);
nRet = IGallery_Delete(pMe->piGallery
,pSQLBaseName
,&piSQLStmt
);
nErr = IFILEMGR_Remove(pIFileMgr, pSQLFileFull);

----------------------------------------------------------------------------------
Can you give me suggestions . . .
Thanks ,
Gao Feng

Hi Edward ,
+---------------------About Rollback --------------------------+
Rollback on the database, a simple Demo can explain it?
Gallery I found technical support rollback, but I do not find a way to achieve!
+------------------------------------------------------------------+
Wish you Health and Good mood .
Thanks,
Gao Feng

Hi Edward ,
+---------------------About Rollback --------------------------+
Rollback on the database, a simple Demo can explain it?
Gallery I found technical support rollback, but I do not find a way to achieve!
+------------------------------------------------------------------+
Wish you Health and Good mood .
Thanks,
Gao Feng

About the deletion:
It's usually not recommended to do a query and update at the same time since this will potentially create a journal that might get rolled back.
You can also do a re-Sync after you delete the files to update the DB:
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_BASENAME_COL L","AEEGALLERY_FILE_COL,
AEEGALLERY_MEDIATYPE_COL L" = 4 ",
...
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
nRet = ISQLSTMT_GetColumnText(piSQLStmt,0, &pSQLBaseName);
nRet = GetDelStr(pSQLBaseName, &pwReturnDelStr);
nRet = ISQLSTMT_GetColumnText(piSQLStmt, 1, &pSQLFileFull);
nErr = IFILEMGR_Remove(pIFileMgr, pSQLFileFull);

// make sure to release all query stmt here which will release the lock
RELEASEIF(piSQLStmt);
nRet = IGallery_Sync(...);
About the demo:
We're planning to write a simple gallery demo app which might have this, we'll let you know.

About the deletion:
It's usually not recommended to do a query and update at the same time since this will potentially create a journal that might get rolled back.
You can also do a re-Sync after you delete the files to update the DB:
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_BASENAME_COL L","AEEGALLERY_FILE_COL,
AEEGALLERY_MEDIATYPE_COL L" = 4 ",
...
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
nRet = ISQLSTMT_GetColumnText(piSQLStmt,0, &pSQLBaseName);
nRet = GetDelStr(pSQLBaseName, &pwReturnDelStr);
nRet = ISQLSTMT_GetColumnText(piSQLStmt, 1, &pSQLFileFull);
nErr = IFILEMGR_Remove(pIFileMgr, pSQLFileFull);

// make sure to release all query stmt here which will release the lock
RELEASEIF(piSQLStmt);
nRet = IGallery_Sync(...);
About the demo:
We're planning to write a simple gallery demo app which might have this, we'll let you know.

Hi Edward ,
Thank you for your help.
Question:
--------------------------------------------------------------------------
10fs:shared / There are two file data, start simulator, push to OK Key
Return for the 2 ------- OK to return to
20However fs:shared / add a new data, by the end of power Key, and then OK Key
Return for the 2 --------- Err
Repeat 20 Once operation, Return for the 3 -------- OK
--------------------------------------------------------------------------
When the fs:shared / add new files, how to ensure that new data show that normal?
thanks
GaoFeng

Hi Edward ,
Thank you for your help.
Question:
--------------------------------------------------------------------------
10fs:shared / There are two file data, start simulator, push to OK Key
Return for the 2 ------- OK to return to
20However fs:shared / add a new data, by the end of power Key, and then OK Key
Return for the 2 --------- Err
Repeat 20 Once operation, Return for the 3 -------- OK
--------------------------------------------------------------------------
When the fs:shared / add new files, how to ensure that new data show that normal?
thanks
GaoFeng

Hi Edward ,
Question 2:
----------------------------------------------------------------------------------
{
......
IGallery_MountDirs (...);
nRet = IGallery_Sync (...,Gallery_SyncNotifyCB, ...);
......

int Gallery_SyncNotifyCB
{
.......

----------------------------------------------------------------------------------
The role and use of Gallery_SyncNotifyCB can detailed it?
now I face the problem of database update?
Thanks,
GaoFeng

Hi Edward ,
Question 2:
----------------------------------------------------------------------------------
{
......
IGallery_MountDirs (...);
nRet = IGallery_Sync (...,Gallery_SyncNotifyCB, ...);
......

int Gallery_SyncNotifyCB
{
.......

----------------------------------------------------------------------------------
The role and use of Gallery_SyncNotifyCB can detailed it?
now I face the problem of database update?
Thanks,
GaoFeng

Hi Edward ,
happy weekend
Question 3:
-------------------------------------------------------------------------------
If I have two memory card and a fs: / shard / ...
how to use the IGallery_MountDirs (IGallery * pif, const char * pszURLs);
-------------------------------------------------------------------------------
Thanks,
GaoFeng

Hi Edward ,
happy weekend
Question 3:
-------------------------------------------------------------------------------
If I have two memory card and a fs: / shard / ...
how to use the IGallery_MountDirs (IGallery * pif, const char * pszURLs);
-------------------------------------------------------------------------------
Thanks,
GaoFeng

Hi GaoFeng,
Question 1:
I'm not sure what the question is, can you clarify?
Question 2:
The role of Gallery_SyncNotifyCB is for asynchronous notification. The CB function will be called when sync is done.
What problem are you seeing with the database update?
Question 3:
nRetVal = IGallery_MountDirs(piGallery, "fs:/shared/;fs:/card0/;fs:/card1/");

Hi GaoFeng,
Question 1:
I'm not sure what the question is, can you clarify?
Question 2:
The role of Gallery_SyncNotifyCB is for asynchronous notification. The CB function will be called when sync is done.
What problem are you seeing with the database update?
Question 3:
nRetVal = IGallery_MountDirs(piGallery, "fs:/shared/;fs:/card0/;fs:/card1/");

Hi Edward ,
Thank you for your help.
Question2:
--------------------------------------------------------------------------
fs: / shared / image / picture files two A.jpg, B.jpg, at this time of B.jpg query, the results of the return is true, then I will C.jpg, on the "fs: / shared / image / ", at this time of C.jpg query, and then restart the simulator, the results did not query that the database did not find this record, and then restart the emulator again, return is true.
I feel that the problem is in the IGallery_Sync function, it is not the first time to add new data in the DB.
How can update DB, could you give an Demo?
--------------------------------------------------------------------------
Thanks,
GaoFeng

Hi Edward ,
Thank you for your help.
Question2:
--------------------------------------------------------------------------
fs: / shared / image / picture files two A.jpg, B.jpg, at this time of B.jpg query, the results of the return is true, then I will C.jpg, on the "fs: / shared / image / ", at this time of C.jpg query, and then restart the simulator, the results did not query that the database did not find this record, and then restart the emulator again, return is true.
I feel that the problem is in the IGallery_Sync function, it is not the first time to add new data in the DB.
How can update DB, could you give an Demo?
--------------------------------------------------------------------------
Thanks,
GaoFeng

Hi Edward ,
Thank you for your help.
From Gallery , how to obtain information such as DRM:
AEEGALLERY_DRMSTATUS_COL
AEEGALLERY_DRMFORWARDLOCKED_COL
AEEGALLERY_DRMHASMETERED_COL
AEEGALLERY_DRMSRAFAILED_COL
AEEGALLERY_DRMTYPE_COL
AEEGALLERY_DRMEXPIRATION_COL
The implementation of the following code:
--------------------------------------------------------
ISQLSTMT_GetColumnInt(piSQLStmt, 1, &pDrmTatus);
ISQLSTMT_GetColumnInt(piSQLStmt, 2, &pDramForwaredlocked);
ISQLSTMT_GetColumnInt(piSQLStmt, 3, &pDrmHasmetered);
ISQLSTMT_GetColumnInt(piSQLStmt, 4, &pDrmSrafailed);
ISQLSTMT_GetColumnInt(piSQLStmt, 5, &pDrmType);
ISQLSTMT_GetColumnInt(piSQLStmt, 6, &pDrmExpiration);
return results are as follows:
AEEGALLERY_DRMSTATUS_COL = 0
AEEGALLERY_DRMFORWARDLOCKED_COL = 0
AEEGALLERY_DRMHASMETERED_COL = 0
AEEGALLERY_DRMSRAFAILED_COL = 0
AEEGALLERY_DRMTYPE_COL = 4
AEEGALLERY_DRMEXPIRATION_COL = 0
--------------------------------------------------------
Can you give me suggestions?
Thanks,
GaoFeng

Hi Edward ,
Thank you for your help.
From Gallery , how to obtain information such as DRM:
AEEGALLERY_DRMSTATUS_COL
AEEGALLERY_DRMFORWARDLOCKED_COL
AEEGALLERY_DRMHASMETERED_COL
AEEGALLERY_DRMSRAFAILED_COL
AEEGALLERY_DRMTYPE_COL
AEEGALLERY_DRMEXPIRATION_COL
The implementation of the following code:
--------------------------------------------------------
ISQLSTMT_GetColumnInt(piSQLStmt, 1, &pDrmTatus);
ISQLSTMT_GetColumnInt(piSQLStmt, 2, &pDramForwaredlocked);
ISQLSTMT_GetColumnInt(piSQLStmt, 3, &pDrmHasmetered);
ISQLSTMT_GetColumnInt(piSQLStmt, 4, &pDrmSrafailed);
ISQLSTMT_GetColumnInt(piSQLStmt, 5, &pDrmType);
ISQLSTMT_GetColumnInt(piSQLStmt, 6, &pDrmExpiration);
return results are as follows:
AEEGALLERY_DRMSTATUS_COL = 0
AEEGALLERY_DRMFORWARDLOCKED_COL = 0
AEEGALLERY_DRMHASMETERED_COL = 0
AEEGALLERY_DRMSRAFAILED_COL = 0
AEEGALLERY_DRMTYPE_COL = 4
AEEGALLERY_DRMEXPIRATION_COL = 0
--------------------------------------------------------
Can you give me suggestions?
Thanks,
GaoFeng

Hi GaoFeng,
Update question:
Check your fs:/shared directory after calling sync, is there a gallery.db-journal there? If so, that means the database is locked when you're trying to update gallery, which means the update can't go through until after you've released the lock.
We are in the process of creating a demo, I'll let you know when it is done.
DRM question:
Please refer to AEEGallerySchema.h about what those values mean.
In your example, the file does not have DRM protection, so the status is AEEGALLERY_DRMSTATUS_UNPROTECTED, and the type is AEEGALLERY_DRMRIGHTSTYPE_UNCONSTRAINED.

Hi GaoFeng,
Update question:
Check your fs:/shared directory after calling sync, is there a gallery.db-journal there? If so, that means the database is locked when you're trying to update gallery, which means the update can't go through until after you've released the lock.
We are in the process of creating a demo, I'll let you know when it is done.
DRM question:
Please refer to AEEGallerySchema.h about what those values mean.
In your example, the file does not have DRM protection, so the status is AEEGALLERY_DRMSTATUS_UNPROTECTED, and the type is AEEGALLERY_DRMRIGHTSTYPE_UNCONSTRAINED.

Hi Edward ,
Thank you for your reply.
DRM question:
1, file is DRM protected files to write
2, as follows:
The implementation of the following code:
--------------------------------------------------------
ISQLSTMT_GetColumnInt(piSQLStmt, 1, &pDrmTatus);
ISQLSTMT_GetColumnInt(piSQLStmt, 2, &pDramForwaredlocked);
ISQLSTMT_GetColumnInt(piSQLStmt, 3, &pDrmHasmetered);
ISQLSTMT_GetColumnInt(piSQLStmt, 4, &pDrmSrafailed);
ISQLSTMT_GetColumnInt(piSQLStmt, 5, &pDrmType);
ISQLSTMT_GetColumnInt(piSQLStmt, 6, &pDrmExpiration);
return results are as follows:
AEEGALLERY_DRMSTATUS_COL = 0
AEEGALLERY_DRMFORWARDLOCKED_COL = 0
AEEGALLERY_DRMHASMETERED_COL = 0
AEEGALLERY_DRMSRAFAILED_COL = 0
AEEGALLERY_DRMTYPE_COL = 4
AEEGALLERY_DRMEXPIRATION_COL = 0
--------------------------------------------------------
3, through the value AEEGallerySchema.h explained,why not correct?
I feel that the method may not correct it.
Thanks,
GaoFeng

Hi Edward ,
Thank you for your reply.
DRM question:
1, file is DRM protected files to write
2, as follows:
The implementation of the following code:
--------------------------------------------------------
ISQLSTMT_GetColumnInt(piSQLStmt, 1, &pDrmTatus);
ISQLSTMT_GetColumnInt(piSQLStmt, 2, &pDramForwaredlocked);
ISQLSTMT_GetColumnInt(piSQLStmt, 3, &pDrmHasmetered);
ISQLSTMT_GetColumnInt(piSQLStmt, 4, &pDrmSrafailed);
ISQLSTMT_GetColumnInt(piSQLStmt, 5, &pDrmType);
ISQLSTMT_GetColumnInt(piSQLStmt, 6, &pDrmExpiration);
return results are as follows:
AEEGALLERY_DRMSTATUS_COL = 0
AEEGALLERY_DRMFORWARDLOCKED_COL = 0
AEEGALLERY_DRMHASMETERED_COL = 0
AEEGALLERY_DRMSRAFAILED_COL = 0
AEEGALLERY_DRMTYPE_COL = 4
AEEGALLERY_DRMEXPIRATION_COL = 0
--------------------------------------------------------
3, through the value AEEGallerySchema.h explained,why not correct?
I feel that the method may not correct it.
Thanks,
GaoFeng

Hi GaoFeng,
Which DRM protection scheme are you testing with (OMA, Microsoft/Janus, or something else)?

Hi GaoFeng,
Which DRM protection scheme are you testing with (OMA, Microsoft/Janus, or something else)?

Hi Edward ,
Thank you for your reply.
"We are in the process of creating a demo, I'll let you know when it is done. "
The demo will give me a look?
Thanks,
GaoFeng

Hi Edward ,
Thank you for your reply.
"We are in the process of creating a demo, I'll let you know when it is done. "
The demo will give me a look?
Thanks,
GaoFeng

Hi Edward ,
Thank you for your reply.
If I have a DRM file
The following operation, read DRM files:
----------------------------------------------------------------------------------
nRet = IGallery_Query(pMe->piGallery,
...
L", " AEEGALLERY_DRMSTATUS_COL
L", " AEEGALLERY_DRMFORWARDLOCKED_COL
L", " AEEGALLERY_DRMHASMETERED_COL
L", " AEEGALLERY_DRMSRAFAILED_COL
L", " AEEGALLERY_DRMTYPE_COL
L", " AEEGALLERY_DRMEXPIRATION_COL ,
AEEGALLERY_MEDIATYPE_COL L" = 2 and " AEEGALLERY_BASENAME_COL L" = ?3",
.......);
nRet = ISQLSTMT_BindWText(
piSQLStmt,
3,
pwName,
-1 ,
-1
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
ISQLSTMT_GetColumnInt(piSQLStmt, 1, &pDrmTatus);
ISQLSTMT_GetColumnInt(piSQLStmt, 2, &pDramForwaredlocked);
ISQLSTMT_GetColumnInt(piSQLStmt, 3, &pDrmHasmetered);
ISQLSTMT_GetColumnInt(piSQLStmt, 4, &pDrmSrafailed);
ISQLSTMT_GetColumnInt(piSQLStmt, 5, &pDrmType);
ISQLSTMT_GetColumnInt(piSQLStmt, 6, &pDrmExpiration);
.......

----------------------------------------------------------------------------------
The operation of the above can be read by the DRM of the information?
Thanks,
GaoFeng

Hi Edward ,
Thank you for your reply.
If I have a DRM file
The following operation, read DRM files:
----------------------------------------------------------------------------------
nRet = IGallery_Query(pMe->piGallery,
...
L", " AEEGALLERY_DRMSTATUS_COL
L", " AEEGALLERY_DRMFORWARDLOCKED_COL
L", " AEEGALLERY_DRMHASMETERED_COL
L", " AEEGALLERY_DRMSRAFAILED_COL
L", " AEEGALLERY_DRMTYPE_COL
L", " AEEGALLERY_DRMEXPIRATION_COL ,
AEEGALLERY_MEDIATYPE_COL L" = 2 and " AEEGALLERY_BASENAME_COL L" = ?3",
.......);
nRet = ISQLSTMT_BindWText(
piSQLStmt,
3,
pwName,
-1 ,
-1
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
ISQLSTMT_GetColumnInt(piSQLStmt, 1, &pDrmTatus);
ISQLSTMT_GetColumnInt(piSQLStmt, 2, &pDramForwaredlocked);
ISQLSTMT_GetColumnInt(piSQLStmt, 3, &pDrmHasmetered);
ISQLSTMT_GetColumnInt(piSQLStmt, 4, &pDrmSrafailed);
ISQLSTMT_GetColumnInt(piSQLStmt, 5, &pDrmType);
ISQLSTMT_GetColumnInt(piSQLStmt, 6, &pDrmExpiration);
.......

----------------------------------------------------------------------------------
The operation of the above can be read by the DRM of the information?
Thanks,
GaoFeng

Yes the demo will have sync and update examples, but which problem are you seeing now specifically?
"If I have a DRM file"
What kind of DRM file is this? What is the DRM protection schema?

Yes the demo will have sync and update examples, but which problem are you seeing now specifically?
"If I have a DRM file"
What kind of DRM file is this? What is the DRM protection schema?

Hi Edward,
Question1 :
"Yes the demo will have sync and update examples"
->The demo is in the library ?
Question2 :
"Which DRM protection scheme are you testing with (OMA, Microsoft/Janus, or something else)?
"
->Microsoft
Thanks,
GaoFeng

Hi Edward,
Question1 :
"Yes the demo will have sync and update examples"
->The demo is in the library ?
Question2 :
"Which DRM protection scheme are you testing with (OMA, Microsoft/Janus, or something else)?
"
->Microsoft
Thanks,
GaoFeng

The demo has not been released yet (not finished yet), so it is not in the library.
DRM question:
We don't support DRM related functionality on simulator, on hardware device this should work correctly.

The demo has not been released yet (not finished yet), so it is not in the library.
DRM question:
We don't support DRM related functionality on simulator, on hardware device this should work correctly.

Hi Edward,
I wants to achieve ReName functions as follows:
+------------------Begin---------------------+
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_ARTIST_COL L", "
AEEGALLERY_BASENAME_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2",
&
&piSQLStmt
);
nRet = IGallery_Update(pMe->piGallery
,AEEGALLERY_BASENAME_COL L" = 'NewMusic1'"
,AEEGALLERY_BASENAME_COL L" ='Music1'"
,&piSQLStmt);
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_ARTIST_COL L", "
AEEGALLERY_BASENAME_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2",
&
&piSQLStmt
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
nRet = ISQLSTMT_GetColumnText(piSQLStmt, 1, &pSQLBaseName);

Actual Result:
---------------------> Music1
Looking forward to the results:
---------------------> NewMusic1
+------------------end---------------------+
Thanks,
gaofeng

Hi Edward,
I wants to achieve ReName functions as follows:
+------------------Begin---------------------+
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_ARTIST_COL L", "
AEEGALLERY_BASENAME_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2",
&
&piSQLStmt
);
nRet = IGallery_Update(pMe->piGallery
,AEEGALLERY_BASENAME_COL L" = 'NewMusic1'"
,AEEGALLERY_BASENAME_COL L" ='Music1'"
,&piSQLStmt);
nRet = IGallery_Query(pMe->piGallery,
AEEGALLERY_ARTIST_COL L", "
AEEGALLERY_BASENAME_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2",
&
&piSQLStmt
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
nRet = ISQLSTMT_GetColumnText(piSQLStmt, 1, &pSQLBaseName);

Actual Result:
---------------------> Music1
Looking forward to the results:
---------------------> NewMusic1
+------------------end---------------------+
Thanks,
gaofeng

Hi GaoFeng,
You need to call _Step after the _Update to execute it:
nRet = IGallery_Update(pMe->piGallery,
pwszSetClause,
pwszWhereClause,
&piSQLStmt);
nRet = ISQLSTMT_Step(piSQLStmt);
(_Step will return SQL_DONE to indicate SUCCESS)

Hi GaoFeng,
You need to call _Step after the _Update to execute it:
nRet = IGallery_Update(pMe->piGallery,
pwszSetClause,
pwszWhereClause,
&piSQLStmt);
nRet = ISQLSTMT_Step(piSQLStmt);
(_Step will return SQL_DONE to indicate SUCCESS)

Hi Edward ,
Thank you for your help.
How to update the Gallery DB, you can tell me the specific way? I have this problem, there is no way to solve, it is painful!
I wish you happy in your work.
Thanks ,
GaoFeng

Hi Edward ,
Thank you for your help.
How to update the Gallery DB, you can tell me the specific way? I have this problem, there is no way to solve, it is painful!
I wish you happy in your work.
Thanks ,
GaoFeng

Hi Edward ,
On the database of memory leak problem, Please advise.
For example, to achieve the following:
+--------------------------------------------+
nRet = IGallery_Query(pMe->pIGallery,
AEEGALLERY_FILE_COL L", "AEEGALLERY_BASENAME_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2",
& &
&piSQLStmt
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
nRet = IGallery_Delete( pMe->pIGallery
,waBufDelStr ,&piSQLStmt );

ISQLSTMT_Release(piSQLStmt);
+--------------------------------------------+
Why is there still a memory leak it?
Can you give me suggestions ?
Thanks ,
GaoFeng

Hi Edward ,
On the database of memory leak problem, Please advise.
For example, to achieve the following:
+--------------------------------------------+
nRet = IGallery_Query(pMe->pIGallery,
AEEGALLERY_FILE_COL L", "AEEGALLERY_BASENAME_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2",
& &
&piSQLStmt
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmt)))
{
nRet = IGallery_Delete( pMe->pIGallery
,waBufDelStr ,&piSQLStmt );

ISQLSTMT_Release(piSQLStmt);
+--------------------------------------------+
Why is there still a memory leak it?
Can you give me suggestions ?
Thanks ,
GaoFeng

Hi GaoFeng,
About the update:
Calling IGallery_Update followed by ISQLSTMT_Step doesn't work for you?
About the memory leak:
Please use a different ISQLStmt object for each of the Gallery API calls, or free them before reusing one, for example:
nRet = IGallery_Query(pMe->pIGallery,
AEEGALLERY_FILE_COL L", "AEEGALLERY_BASENAME_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2",
& &
&piSQLStmtQuery
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmtQuery)))
{
nRet = IGallery_Delete( pMe->pIGallery
,waBufDelStr ,&piSQLStmtDelete);

ISQLSTMT_Release(piSQLStmtQuery);
ISQLSTMT_Release(piSQLStmtDelete);

Hi GaoFeng,
About the update:
Calling IGallery_Update followed by ISQLSTMT_Step doesn't work for you?
About the memory leak:
Please use a different ISQLStmt object for each of the Gallery API calls, or free them before reusing one, for example:
nRet = IGallery_Query(pMe->pIGallery,
AEEGALLERY_FILE_COL L", "AEEGALLERY_BASENAME_COL,
AEEGALLERY_MEDIATYPE_COL L" = 2",
& &
&piSQLStmtQuery
);
while (SQL_ROW == (nRet = ISQLSTMT_Step(piSQLStmtQuery)))
{
nRet = IGallery_Delete( pMe->pIGallery
,waBufDelStr ,&piSQLStmtDelete);

ISQLSTMT_Release(piSQLStmtQuery);
ISQLSTMT_Release(piSQLStmtDelete);

Hi Edward ,
Can work, update a record has been resolved! --------->OK
I would like to ask, how to update the Gallery DB, for example, I click the Refresh button to all updates the Gallery DB.
Can you give me advice?
Thanks ,
GaoFeng

Hi Edward ,
Can work, update a record has been resolved! --------->OK
I would like to ask, how to update the Gallery DB, for example, I click the Refresh button to all updates the Gallery DB.
Can you give me advice?
Thanks ,
GaoFeng

Hi Edward ,
how to realize the indistinct query in Gallery?
Thanks ,
GaoFeng

Hi Edward ,
how to realize the indistinct query in Gallery?
Thanks ,
GaoFeng

Hi GaoFeng,
To update the entire gallery DB, you can call sync with the default dirs:
IGallery_Sync(piGallery, NULL, pfnNotify, pData);
or call the sync default:
IGallery_SyncDefault(piGallery, pfnNotify, pData);
They both achieves the same thing: insert, remove, and updates all files under the default directories (fs:/shared and card).
Can you please clarify what you meant by indistinct query?

Hi GaoFeng,
To update the entire gallery DB, you can call sync with the default dirs:
IGallery_Sync(piGallery, NULL, pfnNotify, pData);
or call the sync default:
IGallery_SyncDefault(piGallery, pfnNotify, pData);
They both achieves the same thing: insert, remove, and updates all files under the default directories (fs:/shared and card).
Can you please clarify what you meant by indistinct query?

Hi Edward ,
Thank you for help this time, I wish you success in your work,Brilliant career !
Thanks,
GaoFeng

Hi Edward ,
Thank you for help this time, I wish you success in your work,Brilliant career !
Thanks,
GaoFeng