Smita Kapse has Published 498 Articles

How can I marquee the text content in Android Notification?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

325 Views

This example demonstrate about How can I marquee the text content in Android Notification.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     ... Read More

Sum MongoDB Sub-documents field?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

204 Views

You can use aggregate framework for this. Let us first create a collection with documents −> db.summingSubDocumentDemo.insertOne( ... { "_id" :101, "CustomerDetails" : { "CustomerPurchase" : { "CustomerPurchaseAmount" : 2000 } } }); { "acknowledged" : true, "insertedId" : 101 } > db.summingSubDocumentDemo.insertOne( { "_id" :102, "CustomerDetails" : { ... Read More

How to create an Android notification with a longer text?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

368 Views

This example demonstrate about How to create an Android notification with a longer textStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     ... Read More

Calculate average of ratings in array and then include the field to original document in MongoDB?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

353 Views

You can use $avg operator along with aggregate framework. Let us first create a collection with documents −> db.averageOfRatingsInArrayDemo.insertOne( ...   { ...      "StudentDetails":[ ...         { ...             "StudentId":1, ...             "StudentScore":45 ... ... Read More

How to determine database type (name) for a given JDBC connection?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

4K+ Views

One way to get the name of the underlying database you have connected with is by invoking the getDatabaseProductName() method of the DatabaseMetaData interface. This method returns the name of the underlying database in String format.Therefore, to retrieve the name of your current database using Java code −Retrieve the DatabaseMetaData ... Read More

What are the sizes of the icons in Android notifications action-buttons?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

157 Views

Asset Size: 32dp x 32dp Optical Square: 24dp x 24dp Color (Enabled): #FFFFFF 80% opacity Color (Disabled): #FFFFFF 30% opacityClick  here  to download the project code

Java Program to display JTabbedPane on the right

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

146 Views

To display JTabbedPane on the right, you need to set the location to the right using the constant RIGHT −JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.RIGHT);The following is an example to display JTabbedPane on the right −Examplepackage my; import javax.swing.*; public class SwingDemo {    public static void main(String args[]) {   ... Read More

How to find MongoDB documents in a collection with a filter on multiple combined fields?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

344 Views

You can use $or operator along with find() for this. Let us first create a collection with documents −> db.findDocumentWithFilterDemo.insertOne({"ClientName":"Robert", "IsMarried":false}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd4fd1e2cba06f46efe9ef1") } > db.findDocumentWithFilterDemo.insertOne({"ClientName":"Chris", "IsMarried":true}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd4fd322cba06f46efe9ef2") } > db.findDocumentWithFilterDemo.insertOne({"ClientName":"David", "IsMarried":true}); {    "acknowledged" ... Read More

How to open an activity after receiving a PUSH notification in Android?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

3K+ Views

This example demonstrate about How to open an activity after receiving a PUSH notification in AndroidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to src/MyFirebaseMessagingService.javapackage app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; ... Read More

Want to update inner field in a MongoDB

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

178 Views

To update the inner field, use the below syntax −db.yourCollectionName.update({"_id" : yourObjectId}, {$set : {"yourOuterFieldName.yourInnerFieldName" :yourValue}});Let us first create a collection with documents −> db.updateDocumentDemo.insertOne( ...   { ... ...      "StudentDetails" : { ...         "StudentFirstName" : "Adam", ...         "StudentLastName" : ... Read More

Advertisements