Click here to Skip to main content
15,123,819 members

Comments by Member 14192879 (Top 35 by date)

Member 14192879 27-Sep-21 1:08am View
   
NotificationManagerCompat notificationManager = NotificationManagerCompat.From(this);
StartForeground(NOTIFICATION_SERVICE_ID, builder.Build());
}




//every 5 seconds push a notificaition
private void DispatchNotificationThatAlarmIsGenerated(string message)
{
var intent = new Intent(this, typeof(MainActivity));
intent.AddFlags(ActivityFlags.ClearTop);
var pendingIntent = PendingIntent.GetActivity(this, 0, intent, PendingIntentFlags.OneShot);

Notification.Builder notificationBuilder = new Notification.Builder(this, NOTIFICATION_CHANNEL_ID)
.SetSmallIcon(Resource.Drawable.s)
.SetContentTitle("Alarm")
.SetContentText(message)
.SetAutoCancel(true)
.SetContentIntent(pendingIntent);

var notificationManager = (NotificationManager)GetSystemService(NotificationService);
notificationManager.Notify(NOTIFICATION_AlARM_ID, notificationBuilder.Build());
}
Member 14192879 27-Sep-21 1:07am View
   
thank you for your useful time. after some articles and your helpful link. i find below code and it works fine... but problem is that it always show the "service start". how can I hide this notification? i this want app keep sending message to client but first it does not show the foreground service "service started" notiifcation.
private Handler handler;
private Action runnable;
private bool isStarted;
private int DELAY_BETWEEN_LOG_MESSAGES = 5000;
private int NOTIFICATION_SERVICE_ID = 1001;
// private int NOTIFICATION_AlARM_ID = 1002;
private int NOTIFICATION_AlARM_ID = 1;
private string NOTIFICATION_CHANNEL_ID = "1003";
private string NOTIFICATION_CHANNEL_NAME = "MyChannel";
public int i;
public override void OnCreate()
{
base.OnCreate();

handler = new Handler();

//here is what you want to do always, i just want to push a notification every 5 seconds here
runnable = new Action(() =>
{
if (isStarted)
{
DispatchNotificationThatAlarmIsGenerated("I'm running"+ i++);
handler.PostDelayed(runnable, DELAY_BETWEEN_LOG_MESSAGES);
NOTIFICATION_AlARM_ID++;
}
});
}

public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
{
if (isStarted)
{
// service is already started
}
else
{
CreateNotificationChannel();
DispatchNotificationThatServiceIsRunning();
handler.PostDelayed(runnable, DELAY_BETWEEN_LOG_MESSAGES);
isStarted = true;
}
return StartCommandResult.Sticky;
}

public override void OnTaskRemoved(Intent rootIntent)
{
//base.OnTaskRemoved(rootIntent);
}

public override IBinder OnBind(Intent intent)
{
// Return null because this is a pure started service. A hybrid service would return a binder that would
// allow access to the GetFormattedStamp() method.
return null;
}

public override void OnDestroy()
{
// Stop the handler.
handler.RemoveCallbacks(runnable);

// Remove the notification from the status bar.
var notificationManager = (NotificationManager)GetSystemService(NotificationService);
notificationManager.Cancel(NOTIFICATION_SERVICE_ID);

isStarted = false;
base.OnDestroy();
}

private void CreateNotificationChannel()
{
//Notification Channel
NotificationChannel notificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, NOTIFICATION_CHANNEL_NAME, NotificationImportance.Max);
notificationChannel.EnableLights(true);
notificationChannel.EnableVibration(true);
notificationChannel.SetVibrationPattern(new long[] { 100, 200, 300, 400, 500, 400, 300, 200, 400 });


NotificationManager notificationManager = (NotificationManager)this.GetSystemService(Context.NotificationService);
notificationManager.CreateNotificationChannel(notificationChannel);
}

//start a foreground notification to keep alive
private void DispatchNotificationThatServiceIsRunning()
{
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.SetDefaults((int)NotificationDefaults.All)
.SetSmallIcon(Resource.Drawable.s)
.SetVibrate(new long[] { 100, 200, 300, 400, 500, 400, 300, 200, 400 })
.SetSound(null)
.SetChannelId(NOTIFICATION_CHANNEL_ID)
.SetPriority(NotificationCompat.PriorityDefault)
.SetAutoCancel(false)
.SetContentTitle("test")
.SetContentText("ervice started")
.SetOngoing(true);
Member 14192879 15-Jul-21 2:08am View
   
my code is working well when I have the only labels but I add an image, it doesn't add an image to pdf and only convert text to pdf
Member 14192879 15-Jul-21 2:06am View
   
Deleted
ss is the stacklayout's name
Member 14192879 15-Jul-21 2:06am View
   
ss is the stacklayout's name
Member 14192879 23-Nov-20 19:38pm View
   
Deleted
https://www.aspsnippets.com/Articles/Issue---allowDefinition-MachineToApplication-beyond-application-level.aspx
Member 14192879 8-Oct-20 19:36pm View
   
I already implemented this code but it add-footer on all pages but I want to add only on the last page.
Member 14192879 7-Oct-20 20:39pm View
   
you can refresh the form by using asp:AsyncPostBackTrigger in update panel. AsyncPostBackTrigger will trigger the timer and update code will refresh panel content(yo==what you have write in <contenttemplate> ) without refreshing the entire form.
you can try this code:
<asp:timer id="Timer1" runat="server" ontick="Timer1_Tick" interval="1000">

<asp:updatepanel id="UpdatePanel1" runat="server" maintainscrollpositiononpostback="true">
<triggers>
<asp:asyncpostbacktrigger controlid="Timer1" eventname="Tick">

<contenttemplate>
your code

Member 14192879 15-Apr-20 1:57am View
   
can we add meeting details below the date in month calender?
Member 14192879 15-Apr-20 1:28am View
   
yes, month calendar. is there any other calendar available?
Member 14192879 12-Apr-20 5:17am View
   
yes I saved date into the database in GMT Format

I want to know how I can pass this javascript on eval("date")


how can I pass this GMT offset to grid view?
Member 14192879 12-Apr-20 4:47am View
   
var now = new Date("January 02, 2012 22: 00: 00 GMT + 0530");
var nowUtc = new Date(now.getTime() + (now.getTimezoneOffset() * 60000));
var nowmillis = now.getTime() + (now.getTimezoneOffset() * 60000);
var nowutcmillis = nowUtc.getTime() + (nowUtc.getTimezoneOffset() * 60000);
var backnow = now.setTime(millis - (now.getTimezoneOffset() * 60000));
var backutc = nowUtc.setTime(millis - (nowUtc.getTimezoneOffset() * 60000));
document.getElementById("demo3").innerHTML = now;

I used this code to retrieve date to localtime and it works well


but I do not know how I can do this gridview date
Member 14192879 9-Apr-20 18:46pm View
   
i used a response to write the output stream mean to write the content of iframe to the output stream.
Member 14192879 28-Mar-20 20:00pm View
   
do you have any reference link for this problem?
Member 14192879 16-Mar-20 19:53pm View
   
I have 3 buttons on the master page. when I click on button1 then the back color of the first button should be changed to the blue and the related page should be open in the content place holder.

for example. when I click on button1 then the only color of the button1 will change to blue and default.aspx will see in the content place holder.
Member 14192879 4-Mar-20 20:22pm View
   
Thank you very much. This solution solved my problem. can we save back the same pdf to the database after some changes in pdf?
Member 14192879 3-Mar-20 22:18pm View
   
no, it's not working, It does not show pdf in an iframe. as well as it is not showing any error
Member 14192879 13-Nov-19 22:50pm View
   
I am not using any panel or form. That white space is the background of datagridview.
Member 14192879 13-Nov-19 22:48pm View
   
i tried all these methods given in the link.
Member 14192879 6-Nov-19 23:09pm View
   
Deleted
I am using MySQL. I want to connect GoDaddy Plesk mysql with a visual studio. I checked IP address even I downloaded MySQL and visual studio again but still, I am facing same problem
Member 14192879 6-Nov-19 6:16am View
   
Deleted
my IP address is correct but the IP address i gave in an example is demo IP. Is there any other way to check that connection is working or not?
Member 14192879 3-Nov-19 16:46pm View
   
i am not getting right code for changing below doc file into byte. i have code for saving pdf but i am still looking for converting dyanmic pdf into bytes.
doc.Open();
StringReader s_tr = new StringReader(s_tw.ToString());
HTMLWorker html_worker = new HTMLWorker(doc);
html_worker.Parse(s_tr);
doc.Close();
Member 14192879 3-Nov-19 16:43pm View
   
actually, I know how to upload pdf with file uploader or with an open dialog box. but I want to save that pdf to the database which is dynamically created.
Member 14192879 1-Nov-19 20:52pm View
   
did you find the solution of this problem?
Member 14192879 1-Nov-19 20:23pm View
   
I used the same as suggested by you but the problem is that when my pdf has only one page then it shows me pdf but when my pdf has more than one page then it shows an error font size is too small. how can I create no of pages in pdf or it creates automatically page?
Member 14192879 29-Oct-19 7:15am View
   
I used the below code to save pdf. but it saves the pdf but the size of the file is very less. and when I unable to open file due to small size
Member 14192879 27-Oct-19 18:07pm View
   
thank a lot. now it's working well
Member 14192879 27-Oct-19 0:43am View
   
firstly I tried by using bound field then my code works well for color changing but my main work is with the Template field so when I check with breakpoints. it does not go to if condition and always go to else statement. what to do?. my code is working properly with the bound field but not with a template field.
Member 14192879 2-Sep-19 23:39pm View
   
MySqlCommand cmdCount = new MySqlCommand("SELECT count(*) from chetans WHERE clientid1=@clientid1 AND clientid=@clientid", con);
cmdCount.Parameters.AddWithValue("@clientid1", TextBox6.Text);
cmdCount.Parameters.AddWithValue("@clientid", TextBox7.Text);
con.Open();
int count = int.Parse(cmdCount.ExecuteScalar().ToString());
i used code now after changes.
count is used to number of entries which for clientid.
but still not updating
Member 14192879 2-Sep-19 5:38am View
   
Deleted
DataTable dt = new DataTable();
MySqlDataReader myReader = null;
MySqlCommand cmd = new MySqlCommand("SELECT `FileName` FROM `D` WHERE `clientid` LIKE '%" + textBox31.Text + "%'", con);
con.Open();
myReader = cmd.ExecuteReader();
while (myReader.Read())
{
//label115.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString();
label115.Text = (myReader["FileName"].ToString());
}
con.Close();
myReader.Close();



private void label115_Click(object sender, EventArgs e)
{
axAcroPDF1.src = label115.Text;
}
IS THIS A CORRECT CODE TO RERIEVE PDF AND SHOW INTO ADOBE SRC?
Member 14192879 2-Sep-19 5:37am View
   
DataTable dt = new DataTable();
MySqlDataReader myReader = null;
MySqlCommand cmd = new MySqlCommand("SELECT `FileName` FROM `D` WHERE `clientid` LIKE '%" + textBox31.Text + "%'", con);
con.Open();
myReader = cmd.ExecuteReader();
while (myReader.Read())
{
//label115.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString();
label115.Text = (myReader["FileName"].ToString());
}
con.Close();
myReader.Close();



private void label115_Click(object sender, EventArgs e)
{
axAcroPDF1.src = label115.Text;
}



IS THIS CORRECT CODE?
Member 14192879 2-Sep-19 5:36am View
   
Deleted
DataTable dt = new DataTable();
MySqlDataReader myReader = null;
MySqlCommand cmd = new MySqlCommand("SELECT `FileName` FROM `D` WHERE `clientid` LIKE '%" + textBox31.Text + "%'", con);
con.Open();
myReader = cmd.ExecuteReader();
while (myReader.Read())
{
//label115.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString();
label115.Text = (myReader["FileName"].ToString());
}
con.Close();
myReader.Close();



private void label115_Click(object sender, EventArgs e)
{
axAcroPDF1.src = label115.Text;
}
Member 14192879 2-Sep-19 5:34am View
   
HOW CAN I RETRIEVE PREVIOUS PDF STORED FILE?
Member 14192879 2-Sep-19 5:33am View
   
can you tell me how can retrieve upload pdf into GridView?
Member 14192879 2-Sep-19 5:14am View
   
what datatype I have to use for 'file' column?